JAVASCRIPT

 Home  Computers & Internet  Web Programming JAVASCRIPT
What is Javascript?
Javascript Placement
Syntax
Reserved Words
Variables
Data Types
Escaping Characters
Concatenation
Arithmetic Operators
Assignment Operators
Comparison Operators
Boolean Operators
Conditional Operator
If Statements
Else If Statements
If Else Statements
Switch Statements
While Loops
For Loops
Do While Loops
Break Statement
Continue Statement
prompt()
alert()
Date()
Event Handlers
String Object Methods
Math Object Methods
Window Object Methods

JAVASCRIPT ASSIGNMENT OPERATORS

In javascript, the = sign is used to assign a value to a variable. There are, however, certain shorthand formats that can be used to save time and code size.

Consider the following example:

var salary;
var extras;

Example 1:

salary = salary + extras;

In shorthand:

salary += extras;

Example 2:

salary = salary - extras;

In shorthand:

salary -= extras;

Example 3:

salary = salary * extras;

In shorthand:

salary *= extras;

Example 4:

salary = salary / extras;

In shorthand:

salary /= extras;

Example 5:

salary = salary % extras;

In shorthand:

salary %= extras;

Home | Privacy Policy | Terms Of Use | Contact Us