Answer & Solution
Answer: Option B
Solution:
A conditional expression in JavaScript is also known as an
immediate if or
ternary operator. The correct answer is option B.
Let's understand the other options:
Option A, "Alternate to if-else," is not an accurate description of a conditional expression. While a conditional expression can be used as an alternative to if-else in certain cases, it is not its primary name.
Option C, "If-then-else statement," is not the commonly used term for a conditional expression. It is more commonly used to refer to the traditional if-else statement structure.
Option D, "None of the mentioned," is incorrect because a conditional expression does have a specific name.
Therefore, option B, "Immediate if," is the correct answer as it accurately describes the conditional expression in JavaScript. It is called "immediate" because it allows for a concise way of expressing a condition and immediately returning a value based on that condition.