How to use Conditional (ternary) Operator - part 4

The conditional (ternary) operator is the only JavaScript operator that takes three operands. This operator is frequently used as a shortcut for the if statement.

Syntax

condition ? expr1 : expr2 
condition (or conditions)
An expression that evaluates to true or false.
expr1expr2
Expressions with values of any type.
How to use Conditional (ternary) Operator - part 4 How to use Conditional (ternary) Operator - part 4 Reviewed by Viththiyakaran on 12:09 AM Rating: 5

No comments:

Powered by Blogger.