45.3k views
0 votes
Which of the following choices is a properly formed JavaScript variable name, meaning it is both legal in the JavaScript language and considered good style

A. user_age
B. UserAge
C. userAge
D. User age

2 Answers

6 votes

Answer:

The answer is C. userAge

Step-by-step explanation:

User Leonardo Villela
by
5.6k points
3 votes

Answer:

userAge ( C )

Step-by-step explanation:

The option (C) is called a camel case and it is used in JavaScript language to to form JavaScript variable name more frequently. it is legal and a good style as well because it is used to different variable names as well.

The option ( B ) is known as pascal case and it can be used in various languages as well, it is used to form a more general variable name and it is not considered a good style in JavaScript language when a specific variable name is to be formed. it is not considered a very good style and it is not very much used like the camel case in JavaScript language.

User Orftz
by
5.5k points