Computer Science, asked by balajilic1431, 4 months ago

Write the syntax of ternary operator and explain.
havbe your brainly

Answers

Answered by mehdwanarsh
0

answer:-)

The conditional (ternary) operator is the only JavaScript operator that takes three operands: a condition followed by a question mark ( ? ), then an expressions  to execute if the condition is truthy followed by a colon ( : ), and finally the expression to execute if the condition is falsy.

syntax

condition ? exprIfTrue : exprIfFalse

Parameters

conditionAn expression whose value is used as a condition

exprIfTrue

An expression which is evaluated if the condition evaluates to a truthy value (one which equals or can be converted to true).

exprIfFalse

An expression which is executed if the condition is falsy (that is, has a value which can be converted to false).

Answered by sciencelover501946
4

Explanation:

The conditional ternary operator is the only java script operator that takes three operands: a condition followed by a question mark (?), thenan exprssion to execute if the condition is truthy followed by a colon (:), and finally the expression to excute if the condition is falsy.

HOPE IT HELP'S........

Similar questions