Operator Symbol | Uses/Description |
---|---|
= = | is equal to |
= = = | is exactly equal to (value and type both) |
! = | is not equal |
> | is greater than |
< | is less than |
> = | is greater than or equal to |
< = | is less than or equal to |
Logical operators are used to determine the logic between variables or values. We can use following logical operators in java script.
&& ( and )
|| ( or )
! ( not )
conditional operator : JavaScript contains conditional operator that assigns a value to a variable based on some condition. Syntax of this conditional operator is as below.
somevariablename = (put condition here) ? value1 : value2
If condition meets then output 'll be 'value1', and if condition doesn't meet then output 'll be 'value2'.
No comments:
Post a Comment