es6 Flashcards
What are the three states a Promise can be in?
pending, fulfilled, or rejected
How do you handle the fulfillment of a Promise?
call the then method of the promise object with the callback function for the success case
How do you handle the rejection of a Promise?
call the catch method of the promise object with the callback function for the failure case
What is Array.prototype.filter useful for?
creating a new array while excluding some elements
What is Array.prototype.map useful for?
creating a new array containing the transformed elements of another
What is Array.prototype.reduce useful for?
combining the elements of an array into a single value
What is “syntactic sugar”?
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
class keyword with ClassName capitalized, followed by curly braces that contain the constructor, render, and other class methods
What is “refactoring”?
the process of restructuring existing computer code without changing its external behavior
What is Webpack?
a tool that bundles all the modules of a JavaScript application into one file
How do you add a devDependency to a package?
npm install dependencyName -D
What is an NPM script?
a command-line command that you add to package.json under the scripts property
How are ES Modules different from CommonJS modules?
more compact syntax and better support for cyclic dependencies
What kind of modules can Webpack support?
ES, CommonJS, AMD, and more