Javascript Relational Operators


Relational Operators
OperatorFunction
v1==v2Test that v1 and v2 are equal.
v1<>v2Test that v1 and v2 are not equal.
v1>v2Test that v1 is greater than v2.
v1>=v2Test that v1 is greater than or equal to v2.
v1<v2Test that v1 is less than v2.
v1<=v2Test that v1 is less than or equal to v2.
v1&&v2Evaluates the logical AND of v1 and v2.
v1||v2Evaluates the logical OR of v1 and v2.
!valueEvaluates the logical NOT of value.

Assignment Operators
OperatorFunction
=Assigns value to variable.
+=Adds value to value already in variable.
-=Subtracts value to value already in variable.
*=Multiplities value with value already in variable.
/=Divides value with value already in variable.
%=Divides value with value already in variable; return remainder.

Math Operators
OperatorFunction
- valueTreats the value as a negative number.
v1+v2Add value v1 and v2 together, ads strings together.
v1-v2Subtracts value v2 from v1.
v1*v2Multiplies value v1 and v2.
v1/v2Divides v1 by v2.
v1%v2Divides v1 by v2; returns floating-point remainder
v1++Adds 1 to v1.
v1--Subtracts 1 from v1.