What is Ternary Operator?
Answers
Answered by
0
Answer:
A ternary operator allows you to assign one value to the variable if the condition is true, and another value if the condition is false. The if else block example from above could now be written as shown in the example below. var num = 4, msg = ""; msg = (num === 4) ?
Answered by
15
Explanation :
Ternary operators deal with three operands. It is also known as the conditional assignment statement because the value assigned to a variable depends upon a logical expression.
Similar questions