Create a Website
CSS Tutorial
FREE Hosting!
With every domain name
you register at DotEasy
you get FREE (no-ad)
one year hosting.
PLUS you get:
  • FREE Website Builder
  • FREE Blog
  • FREE Forum
  • FREE Photo Album
  • FREE Email Accounts
Get your FREE hosting today!
Home > JavaScript Tutorial
$0 Web Hosting

JavaScript operators are used to perform an operation. There are different types of operators for different uses.

JavaScript Operators

The assignment operator = is used to assign values to JavaScript variables.

The assignment operator + is used to add values together.



The value of x, after the execution of the statements above is 7.

JavaScript Arithmetic Operators

Arithmetic operators are used to perform arithmetic between variables and/or values.

Given that y=5, the table below explains the arithmetic operators:

%Modulus (remainder of a division)

JavaScript Assignment Operators

Assignment operators are used to asign values to variables and/or values.

+=Add and assign. For example, x+=y is the same as x=x+y.
-=Subtract and assign. For example, x-=y is the same as x=x-y.
*=Multiply and assign. For example, x*=y is the same as x=x*y.
/=Divide and assign. For example, x/=y is the same as x=x/y.
%=Modulus and assign. For example, x%=y is the same as x=x%y.

String Operators

In JavaScript, a string is simply a piece of text.

+Concatenate (join two strings together)
+=Concatenate and assign

Enjoy this tutorial?

1. Link to this page(copy/paste into your own website or blog):
2. Add this page to your favorite social bookmarks sites:
3. Add this page as your favorites. (Press Ctrl+D)