Home >Web Front-end >JS Tutorial >Equivalence of JS's increment/decrement operator and assignment operator with operation_javascript tips

Equivalence of JS's increment/decrement operator and assignment operator with operation_javascript tips

WBOY
WBOYOriginal
2016-05-16 19:07:261347browse
1. Increment/decrement operator equivalence

a=b; a=b;b=b 1;
a= b ; b=b 1;b=b;
a=b--; a=b;b=b-1;
a=--b; b=b-1;b=b;

So, a=5;b=6;var3=a *--b, the result is 25

2. Assignment operator equivalent with operation

a*=b; a=a*b ;
a/=b; a=a/b;
a =b; a=a b;
a-= b; a=a-b;
a%=b; a=a%b;
a&=b; a=a&b; //Starting from &=, the following are bitwise operators
a|=b; a=a|b;
a^ =b; a=a^b;
a>>=b; a=a>>b;
a a=aa>>>=b; a=a>>b; //C# does not have this operation Talisman
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn