What is a code block? What are some examples of a code block?
-Grouped zero or more statements within curly braces
What does block scope mean?
-A block scope is the area within if, switch conditions or for and while loops.
What is the scope of a variable declared with const or let?
-Those variables exist only within the corresponding block.
What is the difference between let and const?
-Variable declared by let are mutable but variables declared by const are immutable
Why is it possible to .push() a new value into a const variable that points to an Array?
How should you decide on which type of declaration to use?
-For read-only variables, use const
What is the syntax for writing a template literal?
- To substitute a variable and an expression, use this block: ${variable_name}
What is “string interpolation”?
-String interpolation allow you to embed variables and expressions in a string. The JavaScript engine will automatically replace these variables and expressions with their values.
What is destructuring, conceptually?
-Unpacking values from objects and arrays into variables
What is the syntax for Object destructuring?
What is the syntax for Array destructuring?
How can you tell the difference between destructuring and creating Object/Array literals?
What is the syntax for defining an arrow function?
When an arrow function’s body is left without curly braces, what changes in its functionality?
-If there are no curly braces, the expression is automatically returned from the arrow function
How is the value of this determined within an arrow function?
-An arrow function captures the this value of the enclosing context instead of creating its own this context
What are the three states a Promise can be in?
How do you handle the fulfillment of a Promise?
-.then()
How do you handle the rejection of a Promise?
- .catch()
What is “syntactic sugar”?
-In computer science, syntactic sugar is syntax within a programming language that is designed to make things easier to read or to express.
What is the typeof an ES6 class?
-Function
Describe ES6 class syntax.
What is “refactoring”?
-Process of restructuring existing code without changing its external behavior