Operators in JavaScript

JavaScript Operators include these following items as below:

  • Assignment Operators assign a value for variable
  • Arithmetic Operators are used to arithmetic in number: addition, subtraction, multiplication, division, modulus, increment, decrement.
  • Comparison Operators is quite simple to understand. Important note is the difference of == & ===; != & !==.
  • Logical Operators: And/Or/Not

In general, the preference of Operators is simply presented from high to low as below:

  1. ()
  2. ++x
  3. *; /
  4. +; –
  5. >;  <; >=; <=
  6. x++

If operators have same preference, we will do from left to right.

Leave a reply:

Your email address will not be published.

Site Footer

Sliding Sidebar

Facebook