es6 Flashcards
What are the three states a Promise can be in?
pending, fulfilled, rejected
How do you handle the fulfillment of a Promise?
using then method on promise object
How do you handle the rejection of a Promise?
using catch method on promise object
What is “syntactic sugar”?
syntax that is designed to make things easier to read or to express
What is the typeof an ES6 class?
function
Describe ES6 class syntax.
class keyword, class name, curly braces, optional constructor keyword with its parameters.
What is “refactoring”?
the process of restructuring existing code.
What is Webpack?
module bundler
What is an NPM script?
bundle common shell commands
How do you execute Webpack with npm run?
npm run
What must the return value of myFunction be if the following expression is possible?
myFunction() ()
an anonymous function
What does this code do? const wrap = value => () => value
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.
In JavaScript, when is a function’s scope determined; when it is called or when it is defined?
when its being defined.