Among the following, which one is a ternary operator?
a) +
b) :
c) –
d) ?:
Explanation: JavaScript supports one ternary operator, the conditional operator ?:, which combines three expressions into a single expression. If else case can be replaced by the conditional operator.
“An expression that can legally appear on the left side of an assignment expression.” is a well-known explanation for variables, properties of objects, and elements of arrays. They are called…………
a) Properties
b) Prototypes
c) Lvalue
d) Definition
JavaScript is a…….. language.
a) Object-Oriented
b) High-level
c) Assembly-language
d) Object-Based
A conditional expression is also called a………
a) Alternative to if-else
b) Immediate if
c) If-then-else statement
d) Switch statement
When an empty statement is encountered, a JavaScript interpreter………….
a) Ignores the statement
b) Prompts to complete the statement
c) Throws an error
d) Shows a warning
Explanation: The JavaScript interpreter takes no action when it executes an empty statement. The empty statement is occasionally useful when you want to create a loop that has an empty body.
The “var” and “function” are………….
a) Keywords
b) Declaration statements
c) Data types
d) Prototypes