Which names of the following variables are properly declared

Which names of the following variables are properly declared? 1. var _x; 2. var 123Action; 3. var kBoom; 4. var %Remainder; 5. var $myVar; 6. var I_Am_In_Space; 7. var power^two;

A. 1, 2, 3, 6 and 7 B. 1, 3, 5, 6 and 7 C. 1, 3, 5 and 6 D. None of the above sequences are fully properly declared

Solution

Which names of the following variables are properly declared ?

1. var _x ; //FALSE because variable name should not start with a special character.

2. var 123Action ; //FALSE because variable name should not start with a digit.

3. var kBoom ; //TRUE

4. var %Remainder ; //FALSE because variable name should not start with a special character.

5. var $myVar ; //FALSE because variable name should not start with a special character.

6. var I_Am_In_Space ; //TRUE because If we want to provide gap between words we must use \'_\'.

7. var power^two ; //FALSE because variable name should not start with a special character.

Answer :-

A. 1, 2, 3, 6 and 7

B. 1, 3, 5, 6 and 7

C. 1, 3, 5 and 6

D. None of the above sequences are fully properly declared - Correct Answer

Which names of the following variables are properly declared? 1. var _x; 2. var 123Action; 3. var kBoom; 4. var %Remainder; 5. var $myVar; 6. var I_Am_In_Space;

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site