(Solved):What does a question mark mean in JavaScript?

 

Question

What does a question mark mean in JavaScript?

 

EXPERT ANSWER

In JavaScript, the question mark is used as a conditional operator or ternary operator used in C or other languages. It can be thought of as an alternative to an if statement in which a resultant value is returned when the condition gets satisfied. Thus, a value will be assigned to a variable depending on how the condition produces the output. Three

Scroll to top