Contents

Among the following, which one is a ternary operator?
a) +                                                        
b) :
c) –                                                        
d) ?:

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

c

JavaScript is a…….. language.
a) Object-Oriented              
b) High-level
c) Assembly-language
d) Object-Based

d

A conditional expression is also called a………
a) Alternative to if-else
b) Immediate if
c) If-then-else statement
d) Switch statement

b

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

a

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

b