ES6 Flashcards
can explain how => arrow functions are different from function(){} functions
=> is the way of writing ‘function’ in ES6. So it’s the same function() {} - it does not bind this implicitly.
can define a class with both class and instance properties
RESEARCH
can import and export a single default export
RESEARCH
can import and export a set of named exports
RESEARCH
knows how to use async and await
RESEARCH
Explain how “class” transpiles to an ES5 Constructor
- Class allows us to define the constructor function (via class and constructor).
- The constructor function’s prototype object’s prototype (via extends)
- Methods are put on the constructor’s prototype object
- Methods are put on the constructor function itself (static)
- We can reference the base “class” constructor and its prototype information concisely and portably
What is the difference between let, const, and var?
const
means that the identifier can’t be reassigned
let
and var
allow you to reassign variables
What is the difference between context and lexical scope?
context refers to ‘this’
lexical scope is everything in a function object
What is the difference between lexical scope and execution scope?
Execution scope is where and how a function is called in a program