Home > Web Front-end > JS Tutorial > body text

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

WBOY
Release: 2016-05-16 19:07:26
Original
1314 people have browsed it
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
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!