0% found this document useful (0 votes)
94 views3 pages

J S Operators

JavaScript assignment operators assign values to variables. Common assignment operators include the basic = operator as well as shorthand operators like +=, -=, *=, /=, and %= that perform operations like addition, subtraction, multiplication, and modulo assignment. The table shows each assignment operator, its meaning, equivalent shorthand operator, and an example.

Uploaded by

vishnnu9696969
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
94 views3 pages

J S Operators

JavaScript assignment operators assign values to variables. Common assignment operators include the basic = operator as well as shorthand operators like +=, -=, *=, /=, and %= that perform operations like addition, subtraction, multiplication, and modulo assignment. The table shows each assignment operator, its meaning, equivalent shorthand operator, and an example.

Uploaded by

vishnnu9696969
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Javascript

Data types
JavaScript Assignment Operators
 Assignment operators assign values to JavaScript variables.
 The assignment operation evaluates to the assigned value. 
 The following table illustrates assignment operators that are
shorthand for another operator plus the assignment:
 Assignment
 Addition assignment
 Subtraction assignment
 Multiplication assignment
 Division assignment
 Remainder assignment
Assignment Operators
Operator Description Meaning Shorthand Example
operator

= Assign x=y x=y 10+10 = 20

+= Addition assignment x = x + y x += y var a=10; a+=20; Now a = 30

-= Subtraction assignment x=x-y x -= y var a=20; a-=10; Now a = 10

*= Multiplication assignment x = x * y x *= y var a=10; a*=20; Now a = 200

/= Division assignment x=x/y x /= y var a=10; a/=2; Now a = 5

Reminder(modulus) x=x%y x %= y var a=10; a%=2; Now a = 0


%=
assignment

You might also like