Chapter 2 Flashcards
What are examples of ES6 module-loading?
import and `script type=”module”
Module:
a collection of state and publicly exposed methods to operate on that state
Delimit:
surround, separate, define
what are the two forms of values in JS?
primitives and objects
what are the primitive value types in JS?
strings, numbers, symbols, booleans, null, undefined
in JS what is better to use for empty values and why?
undefined; because undefined === undefined but null is an object and has some hidden complexity
what are object values?
objects, arrays and functions
In what ways can typeof be unreliable?
null returns "object" function returns "function" but array returns "object"
Coercion:
converting one value type to another
what is the difference between let and var?
var has function scoping; let uses block scoping
function declaration example
function myFunDeclaration() { }
function expression example
let myFunExpresion = function() { }
what does the === operator do?
disallows type coercion
when does the === operator lie?
NaN and -0
ie:
-0 === 0 // true
NaN === NaN // false
that is the difference in strict operand (===) equality checks for primitives and for objects?
for primitives, it uses structural equality — checking the value or content is the same; for objects, it uses identity equality —checking the reference is the same