Module 3 Flashcards
What is Array.prototype.filter useful for?
It helps create a new array with elements of the array matching specified parameters, which lets you search for specific elements.
What is Array.prototype.map useful for?
It is useful for making changes to all elements of an existing array and assigning it to a new array, without actually modifying the original array.
What is Array.prototype.reduce useful for?
To combine bunch of data using a defined function into one result
What is “syntactic sugar”?
Syntax in a programming language that is designed to be easier to read by humans
What is the typeof an ES6 class?
function
Describe ES6 class syntax.
Declare class ClassName { constructor( ) { } method( ) { } }
What is “refactoring”?
Restructuring code without changing its behavior
Does a class need constructor within?
No
What is Webpack?
Module bundler, takes files and groups into one file
What is an NPM script?
A way to write common commands in a short way rather than typing out the whole thing. Typically stored in package.json, takes a saved command and executes for you.
How are ES Modules different from CommonJS modules?
Syntax differences, ESM can use the import and export keywords, are more compact since it is built in.
What kind of modules can Webpack support?
ES modules, commonJS modules, nearly every JS module.
What is React?
A js library for building user interfaces, it is a javaScript framework for building webpages. Makes setting up a webpage easier than direct dom manipulation.
What is a React element?
A dom element created by react
How do you mount a React element to the DOM?
You use React.createElement( );
What is Babel?
A toolchain that converts ES6 script into backwards compatible JS. Can also convert JSX
What is a Plug-in?
A software addon component that adds a specific feature to an existing computer program
What is a Webpack loader?
A transformation that is applied to source code to transform files from different languages into JS or load inline images as data URLs