Q
What does the expression typeof '123' return in JavaScript?

Answer & Solution

Answer: Option B
Solution:
The typeof operator in JavaScript returns 'string' when applied to a string value, indicating the data type of the value.
Related Questions on Average

What does the expression typeof 42 return in JavaScript?

A). number

B). string

C). undefined

D). boolean

Which of the following statements accurately describes the Boolean data type in JavaScript?

A). It represents textual data

B). It represents numeric data

C). It represents logical values

D). It represents an absence of value

What does the expression typeof true return in JavaScript?

A). number

B). string

C). boolean

D). undefined

Which data type represents variables that have been explicitly set to have no value?

A). Number

B). Undefined

C). String

D). Null

Which primitive data type represents textual data?

A). Number

B). String

C). Boolean

D). Undefined

What is the result of the expression typeof undefined in JavaScript?

A). number

B). string

C). undefined

D). boolean

How is the Undefined data type different from the Null data type in JavaScript?

A). Undefined represents an intentional absence of value

B). Null represents variables not initialized

C). Undefined is used for object keys

D). Null is used for mathematical operations

Which primitive data type represents variables that have been explicitly set to represent no value?

A). Number

B). String

C). Undefined

D). Null

What is the result of the expression typeof 'Hello' in JavaScript?

A). number

B). string

C). undefined

D). boolean

What is the purpose of the Null data type in JavaScript?

A). To represent numeric values

B). To represent an intentional absence of value

C). To represent textual data

D). To represent logical values