WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

JavaScript Assignment


JavaScript Assignment Operators

Assignment operators assign values to JavaScript variables.

Operator Example Same As
= x = y x = y
+= x += y x = x + y
-= x -= y x = x - y
*= x *= y x = x * y
/= x /= y x = x / y
%= x %= y x = x % y

The = assignment operator assigns a value to a variable.

Assignment

var x = 8;
Try it Yourself »

The += assignment operator adds a value to a variable.

Assignment

var x = 8;
x += 4;
Try it Yourself »

The -= assignment operator subtracts a value from a variable.

Assignment

var x = 8;
x -= 4;

The *= assignment operator multiplies a variable.

Assignment

var x = 8;
x *= 4;
Try it Yourself »

The /= assignment divides a variable.

Assignment

var x = 8;
x /= 4;
Try it Yourself »

The %= assignment operator assigns a remainder to a variable.

Assignment

var x = 8;
x %= 4;



Welookups is optimized for learning.Copy right 2018 kumar aditya singh .
All Right Reserved and you agree to have read and accepted our term and condition.
All Rights Reserved.

welookups.com