javaScript operator precedence associativity

precedence   javascript operator precedence determines the order in which operators are evaluated. operators with higher precedence are evaluated first.

                  15 + 15 * 5    //  output   value   90

because multiplication operator ('*') has higher precedence than the addition operator ('+') and thus will be evaluated first.

associativity essentially means the 'direction' in which an expression containing an operator is evaluated.the direction can be   left-to-right   or   right-to-left  .

the following table lists the javascript operators, ordered from highest to lowest precedence.

operatorprecedenceassociativity
.  0  left to right
[]
()
++  1  right to left
--
-
~
!
delete
new
typeof
void
*, /, %  2  left to right
+, -  3
>>  4
>>>
<<
>  5
<
>=
<=
instanceof
==  6
===
!=
!==
&  7
^  8
|  9
&&  10
||  11
? :  12  right to left
=,   *=,   /=,   %=,

+=,   -=,   &=,   ^=,

|=,   <<=,  >>=,  >>>=
  13  right to left
,  14  left to right

note : expressions within parentheses () are evaluated first.

                2 + 4 * 5           //  result    value   is  22
                ( 2 + 4 ) * 5         //result      value   is 30 

javaScript operators Precedence examples

   <script>
   
          var   x = null ,    y = null ,    z = null ,    result=null;
          
          x = 4 , y = 5, z = 6 ;         
          
             result = x++ + ++x / --y * --y ;        //  please  solve this operation
           
           document.write("the  first result  value _______"+ result);
           
           document.write("<br/>"+"x  value ________"+x);
    
  </script>
   <script>           
           
          var  aa = 2 , bb = 4 , cc = 4 ;
           
           result =   ( aa * aa  <=  bb * aa ) && ( --aa * aa--  !== ++bb - --cc)
           
           document.write("the____result___value________"+result);
           
           document.write("<br/>"+"aa___value__"+aa);
           
           document.write("<br/>"+"bb___value___"+cc);
           
   </script>          
    <script>       
         
       var   a = 5 , b =7 , c = 7 ;
          
             result  =  a-- + b % --c ;      //  solve this  
          
                 document.write("<br/>"+"the result value________"+result);
                 
                 document.write("<br/>"+"a _____value ______"+a);
                 
                 document.write("<br/>"+"c _____value ______"+c);
    
     </script>