Lab1 Hard-Coded-Quiz

Question 1: Which of the following is not a JavaScript datatype.

a) Numeric
b) Decimal
c) String
d) Boolean

Question 2: What is the value of n after the following code is executed.

var n;
n = 4 + 2 + "3" + 2;

a) 11
b) 4232
c) 65
d) 632

Question 3: What is the scope of the variable n.

var n;

function doSomething() {

a) global
b) local
c) shared
d) none of the above

Question 4: Which of the following is not a method of document.

a) getElementByID
b) getElementsByClassName
c) getElementsByTagName
d) getElementByValue

Question 5: Which of the following is false about JavaScript arrays.

a) They can hold multiple types of values at once.
b) Array indeces stat at 0.
c) Arrays cannot contain arrays.
d) An array can contain 2^32-1 elements.