JavaScript Variables MCQ Questions & Answers
Javascript (JS) Variables MCQs : This section focuses on the "Javascript Variables". These Multiple Choice Questions (MCQs) should be practiced to improve the Javascript skills required for various interviews (campus interview, walk-in interview, company interview), placement, entrance exam and other competitive examinations.
1. JavaScript allows you to work with __________ primitive data types.
A. 1
B. 2
C. 3
D. 4
View Answer
Ans : C
Explanation: JavaScript allows you to work with three primitive data types : Number, String, Boolean.
2. JavaScript also defines _______ trivial data types.
A. 1
B. 2
C. 3
D. 4
View Answer
Ans : B
Explanation: JavaScript also defines two trivial data types, null and undefined, each of which defines only a single value.
3. Variables are declared with the _______ keyword.
A. this
B. int
C. var
D. new
View Answer
Ans : C
Explanation: Variables are declared with the var keyword
4. Storing a value in a variable is called ?
A. variable declaration
B. variable destroyed
C. variable store
D. variable initialization
View Answer
Ans : D
Explanation: Storing a value in a variable is called variable initialization.
5. JavaScript is untyped language.
A. Yes
B. No
C. Can be yes or no
D. Can not say
View Answer
Ans : A
Explanation: Yes, JavaScript is untyped language.
6. A ___________ has global scope which means it can be defined anywhere in your JavaScript code.
A. local variable
B. global variable
C. simple variable
D. complex variable
View Answer
Ans : B
Explanation: A global variable has global scope which means it can be defined anywhere in your JavaScript code.
7. Which of the following true about JavaScript variable?
A. JavaScript variable names are case-sensitive
B. JavaScript variable names should not start with a numeral
C. You should not use any of the JavaScript reserved keywords as a variable name.
D. All of the above
View Answer
Ans : D
Explanation: All of the above are true about JavaScript Variable Names.
8. Which of the following are javaScript reserved words?
A. enum
B. long
C. finally
D. All of the above
View Answer
Ans : D
Explanation: All of the above are reserved words in JavaScript.
9. byte is reserved word in Javascript?
A. Yes
B. No
C. Can be yes or no
D. Can not say
View Answer
Ans : A
Explanation: Yes, byte is reserved word in Javascript.
10. 123test is an valid variable name?
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: True, 123test is an invalid variable name
Discussion