www.pickatutorial.com Computer Tutorials
Top eBooks: C/C++ | C# | Android | Mathematics | Database | Cloud | Graphics | Networking | Oracle | Hardware | AI
Top Tutorials: C/C++ | C#.NET | PHP MySQL | Java | Java Script | jQuery | HTML | xHTML | HTML5 | VB Script| CSS
Lessons JavaScript Operator Precedence Bookmark and Share
Tutorial Home
Lesson 1
Lesson 2
Lesson 3
Lesson 4
Lesson 5
Lesson 6
Lesson 7
Lesson 8
Lesson 9
Lesson 10
Lesson 11
Lesson 12
Lesson 13
Lesson 14
Lesson 15
Lesson 16
Lesson 17
Lesson 18
Lesson 19
Lesson 20
Lesson 21
Lesson 22
Lesson 23
Lesson 24
Lesson 25
Lesson 26
Lesson 27
Lesson 28
Lesson 29
Lesson 30
Lesson 31
Lesson 32
Lesson 33
Lesson 34
Lesson 35
Lesson 36
Lesson 37
Lesson 38
Lesson 39
Lesson 40
Lesson 41
Lesson 42
Lesson 43
Lesson 44
Lesson 45
Lesson 46
Lesson 47
Lesson 48
Lesson 49

In this lesson we are going to discuss how the expressions are evaluated in JavaScript programming langauge.

Consider the following JavaScript expression:

a = 12 + 5 * 3 / 2 - 456;

What will be the result of the above expression? Ther may be different results depending on the sequence of the operator evaluation e.g. whether the addition operator is evaluated first or last.

The following table lists the precedence of JavaScript operators (high to low):

 Operator type Operator(s)
parenthesis, call and member () [] .
Increment / decrement ++ --
Unary, bitwise and logical + - ~ !
Arithmetic * / %
Arithmetic and string  + -
Bitwise  << >> >>>
Comparison < > <= >=
Comparison == != === !==
Logical &&
Logical ||
Ternary ? :
Assignment = += -= *= /= %= <<= >>= >>>= &= ^= |=
Sequential evaluation ,
The operators === and !== in the above might be the strangers for you. The operator === is used to chech the equality of both the type and the value of its operands. On the contrary the operator !== is used to check the inequality of both the type and the value of its operands.

Next >>> Lesson No. 43: JavaScript Special Characters







Home - Advertise - Contact - Disclaimer - About Us
© Since 2006 pickatutorial.com -- All Rights Reserved.