Scripting in Java Tutorial - Scripting in Java Operators








The List of Operators in Nashorn

Operator      Syntax         
++            ++i i++        
--            --i i--        
delete        delete prop    
void          void expr      
typeof        typeof expr    
+             +op            
-             -op            
~             ~op            
!             !expr          
+             op1 + op2   
-             op1 - op2   
/             op1 / op2    
*             op1 * op2
%             op1 % op2    
in            prop in obj  
instanceof    obj instanceof class
<             op1 < op2    
<=            op1 <= op2  
>             op1 > op2  
>=            op1 >= op2  
==            op1 == op2   
!=            op1 != op2
===           op1 === op2  
!==           op1 !== op2  
<<            op1 << op2  
>>            op1 >> op2  
>>>           op1 >>> op2  
&             op1 & op2     bitwise AND 
|             op1 | op2     bitwise OR 
^             op1 ^ op2     bitwise XOR
&&            op1 && op2    
||            op1 || op2   Logic Or
?:            op1 ? op2 :   
=             op1 = op2    
+=
-=
*=
/=
%=
<<=
>>=
>>>=
&=
^=
|=
,