ES6 Flashcards

1
Q

can explain how => arrow functions are different from function(){} functions

A

=> is the way of writing ‘function’ in ES6. So it’s the same function() {} - it does not bind this implicitly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

can define a class with both class and instance properties

A

RESEARCH

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

can import and export a single default export

A

RESEARCH

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

can import and export a set of named exports

A

RESEARCH

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

knows how to use async and await

A

RESEARCH

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Explain how “class” transpiles to an ES5 Constructor

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the difference between let, const, and var?

A

const means that the identifier can’t be reassigned

let and var allow you to reassign variables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the difference between context and lexical scope?

A

context refers to ‘this’

lexical scope is everything in a function object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the difference between lexical scope and execution scope?

A

Execution scope is where and how a function is called in a program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly