Javascript Flashcards
0
Q
Define a variable in JavaScript.
A
var i = 1;
1
Q
When would want to use the === evaluator as opposed to ==?
A
When want to prevent automatic type conversion
2
Q
What’s an Object?
A
Collection of properties
(Properties called by a dot or a square bracket)
Eg. Math.min();
3
Q
What’s a Method?
A
A property that calls a function.
Eg. array.pop();
4
Q
How are objects created?
A
Create variable Enclose in Curley braces. Separate key value properties by commas. Eg. var objectName = { key:value, key2:[1, 2, 3] };
5
Q
Reading a property that doesn’t exist will produce what value?
A
undefined
6
Q
What Math property rounds down?
A
Math.floor
7
Q
What Math property rounds up (to the nearest whole number)?
A
Math.ceil
8
Q
What Math property rounds to the Nearest whole number?
A
Math.round