Q
Which of the following is not a valid JavaScript variable name according to naming conventions?

Answer & Solution

Answer: Option C
Solution:
According to JavaScript naming conventions, variable names cannot start with a number. Therefore, 2ndVariable is not a valid variable name.
Related Questions on Average

What will the data type of the variable name be if it is assigned the value 'John Doe'?

A). Number

B). String

C). Boolean

D). Undefined

What will be the output of typeof {} in JavaScript?

A). Object

B). Null

C). Undefined

D). Boolean

What is the data type of the value NaN in JavaScript?

A). Null

B). String

C). Number

D). Boolean

What data type is used to represent a collection of key-value pairs in JavaScript?

A). Object

B). Array

C). Map

D). Set

What will be the output of typeof NaN in JavaScript?

A). String

B). Number

C). NaN

D). Undefined

What is the data type of the value Infinity in JavaScript?

A). Number

B). String

C). Boolean

D). Null

Which symbol is used to denote a comment in JavaScript?

A). //

B). --

C). #

D). /* ... */

What will be the data type of the result when dividing a number by zero in JavaScript?

A). Infinity

B). NaN

C). Undefined

D). Null

Which of the following data types is used to represent a function in JavaScript?

A). Func

B). Function

C). Method

D). Procedure

What is the data type of the value true in JavaScript?

A). Boolean

B). String

C). Number

D). Undefined