The Basics Flashcards
What data type is the following
1
Number
What data type is the following
5.283
Number
What data type is the following
“4”
String
What data type is the following
False
Boolean
Which variable statement allows only one assignment, but underlying values can be changed
const
What is the scope of a var
variable? Will declaring a var
twice trigger an error? Will declaring a var
twice trigger an error in strict mode?
The scope of a variable declared with var is its current execution context and closures thereof, which is either the enclosing function and functions declared within it, or, for variables declared outside any function, global. Duplicate variable declarations using var will not trigger an error, even in strict mode, and the variable will not lose its value, unless another assignment is performed.
What basic data types are available for Javascript?
Boolean, String, Number
What is the difference between ===
and ==
?
===
is strict equality vs. ==
equality. Strings and Numbers in strict equality will be seen as false. i.e. 1==="1"
would be false, but 1=="1"
would be true.
Which variable delcaration is safest to use?
What is an expression?
A block of code that evaluates to a value.
What is a statement?
A block of code that performs some kind of action.