Friday, 10 December 2010

Comparison Operators

Javascript Comparison Operators

Operator Description Example
== Equals x == 6 returns true if x is 6
!= Does not equal x != 6 returns true if x is not 6
< Less-than operator. x < 6 returns true if x is less than 6
> Greater-than operator x > 6 returns true if x is greater than 6
>= Greater-than or equal operator x >= 6 returns true if x is either 6, or greater than 6
<= Is less than or equal to x <= 6 returns true if x is either equal to 6, or less than 6

0 comments: