es6 Flashcards

1
Q

What are the three states a Promise can be in?

A

pending, fulfilled, rejected

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

How do you handle the fulfillment of a Promise?

A

using then method on promise object

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

How do you handle the rejection of a Promise?

A

using catch method on promise object

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

What is “syntactic sugar”?

A

syntax that is designed to make things easier to read or to express

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

What is the typeof an ES6 class?

A

function

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

Describe ES6 class syntax.

A

class keyword, class name, curly braces, optional constructor keyword with its parameters.

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

What is “refactoring”?

A

the process of restructuring existing code.

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

What is Webpack?

A

module bundler

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

What is an NPM script?

A

bundle common shell commands

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

How do you execute Webpack with npm run?

A

npm run

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

What must the return value of myFunction be if the following expression is possible?
myFunction() ()

A

an anonymous function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q
What does this code do?
const wrap = value => () => value
A

an anonymous function with parameter value being being defined, within code block another anonymous function is being returned with no parameter, and inside that code block, value of the variable value is being returned.

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

In JavaScript, when is a function’s scope determined; when it is called or when it is defined?

A

when its being defined.

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