Lab 1 Quiz

Question 1: Functions in JavaScript starts with the keyword:

function
method
fun
var

Question 2: Which of the follow is a not a valid JavaScript primitive data type?

Numeric
String
Boolean
Date

Question 3: Which of the follow ways to declare an array is correct?

var color;
     color = ["red", "blue", "yellow"];
var color = ["red", "yellow", 3];
var color = ["red", "yellow", false];
All of the above

Question 4: What will be the value of sum?
var a = 4
var b = "5"
var sum = a + b

undefined
error
45
9

Question 5: When do we use bracket notations?

When we are accessing properties of objects that contains operators
When we might have to convert the property name to a string
It does the same thing as the dot notation, so whenever we feel like it
All of the above