Home >> Javascript >> Assignment operators in Javascript

Assignment operators in Javascript

Operator      Description               Example

=                   Assign                     10+10=20

+=                 Add and assign         a=10;a+=20;a=30

-=                  Substract and assign a=20;a-=10;a=10

*=                 Multiply and assign     a=10;a*=20;a=200

/=                 Divide and assign        a=10;a/=5;a=2

%=               Modulas and assign    a=10;a%=2;a=0

Post Your Comment

Next Questions
Special Operators
Increment / Decrement Operators
Statement
If statement
If else statement
If else if statement
Switch statement
loop
For loop
While loop
Do while loop
Functions
Objects
Array
Events
Onchange event
Onclick event
Onmouseover event
Onmouseout
Onkeydown event
Onload event

Copyright ©2022 coderraj.com. All Rights Reserved.