LFZ ES6 Quiz Flashcards

1
Q

What is a code block? What are some examples of a code block?

A

Anything between {}. An example would be the {} after an if expression

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

What does block scope mean?

A

Anything inside of a code block

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

What is the scope of a variable declared with const or let?

A

The code block it is declared in

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

What is the difference between let and const?

A

you can redeclare let, but you cant redeclare const

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

Why is it possible to .push() a new value into a const variable that points to an Array?

A

the values of the array are mutable

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

What is the syntax for writing a template literal?

A

using the backtick `

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

What is “string interpolation”?

A

string formatting

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

What is destructuring, conceptually?

A

Taking properties from objects and assigning them to variables

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

What is the syntax for Object destructuring?

A

const/let {property: variable name, etc} = object

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

What is the syntax for Array destructuring?

A

const/let [variable name, etc] = array

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

How can you tell the difference between destructuring and creating Object/Array literals?

A

objects have {} and arrays have []

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

What is the syntax for defining an arrow function?

A

let/const verName = functionParameters => (return expression)

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

When an arrow function’s body is left without curly braces, what changes in its functionality?

A

it will implicitly return with out curly braces

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

What are the three states a Promise can be in?

A

pending, fulfilled, and rejected

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

How do you handle the fulfillment of a Promise?

A

with the then method

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

How do you handle the rejection of a Promise?

A

with the catch method

17
Q

What is “syntactic sugar”?

A

syntax within a programming language that is designed to make things easier to read or to express

18
Q

What is the typeof an ES6 class?

A

Function

19
Q

Describe ES6 class syntax.

A

class className { constructor(propertyName) {property assignment} customMethodName(){Method function}}

20
Q

How are ES Modules different from CommonJS modules?

A

ES Modules use Import and export statements, while CommonJS uses require.

21
Q

What kind of modules can Webpack support?

A

ES6, CommonJS, AMD