es6 Flashcards

1
Q

What are the three states a Promise can be in?

A

pending, fulfilled, or 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

call the then method of the promise object with the callback function for the success case

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

call the catch method of the promise object with the callback function for the failure case

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

What is Array.prototype.filter useful for?

A

creating a new array while excluding some elements

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

What is Array.prototype.map useful for?

A

creating a new array containing the transformed elements of another

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

What is Array.prototype.reduce useful for?

A

combining the elements of an array into a single value

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

What is “syntactic sugar”?

A

syntax within a programming language 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
8
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
9
Q

Describe ES6 class syntax

A

class keyword with ClassName capitalized, followed by curly braces that contain the constructor, render, and other class methods

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

What is “refactoring”?

A

the process of restructuring existing computer code without changing its external behavior

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

What is Webpack?

A

a tool that bundles all the modules of a JavaScript application into one file

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

How do you add a devDependency to a package?

A

npm install dependencyName -D

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

What is an NPM script?

A

a command-line command that you add to package.json under the scripts property

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

How are ES Modules different from CommonJS modules?

A

more compact syntax and better support for cyclic dependencies

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

What kind of modules can Webpack support?

A

ES, CommonJS, AMD, and more

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