Module 3 Flashcards
What is Array.prototype.filter useful for?
for finding values in an array
What is Array.prototype.map useful for?
for applying a function to every value of an array
What is Array.prototype.reduce useful for?
applying a function to and compile all values in an array into a single value
What is “syntactic sugar”?
a way to increase code readability, but does not increase functionality
What is the typeof an ES6 class?
function
Describe ES6 class syntax.
class \_\_className\_\_ { constructor (\_\_para1\_\_, \_\_para2\_\_) { this.\_\_prop1\_\_ = \_\_\_\_; this.\_\_prop2\_\_ = \_\_\_\_; } \_\_method1\_\_() {} }
What is “refactoring”?
refactoring is the reorganization of code to increase efficiency without changing the functionality
What is Webpack?
a program that compiles JS files and uses immediately invoked function expressions (IIFE) to run the JS modules
How do you add a devDependency to a package?
npm install –save-dev
What is an NPM script?
a package of pre-written code that you can import and use in your code
How do you execute Webpack with npm run?
use npm install –save-dev webpack
How are ES Modules different from CommonJS modules?
they use ‘import’ and ‘export’ statements to reference other modules vs ‘require’ and ‘module.exports’ statements; standardized module import/export syntax for use with bundlers
What kind of modules can Webpack support?
ECMAScript, CommonJS, AMD
What is React?
a framework that allows components to update w/out reloading the page
What is a React element?
an object that describes a component instance or DOM node and its desired properties; not an HTML element, just contains info about a component
How do you mount a React element to the DOM?
ReactDOM.render()
What is Babel?
a toolkit that converts source code into a backward compatible version
What is a Plug-in?
a downloadable add-in that adds a feature to an existing piece of software
What is a Webpack loader?
an add-in that pre-processes code as modules are compiled
How can you make Babel and Webpack work together?
using the babel-loader