javascript Flashcards

1
Q

What is the purpose of variables?

A

To store data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you declare a variable?

A

A variable keyword and then the variable name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you initialize (assign a value to) a variable?

A

Using the assignment operator (=)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What characters are allowed in variable names?

A

Letters, numbers, dollar sign, or an underscore

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does it mean to say that variable names are “case sensitive”?

A

You can reuse the same name with different capitalization

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the purpose of a string?

A

Holding data in text form

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the purpose of a number?

A

For tasks involving counting or calculating and to store numerical data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the purpose of a boolean?

A

To store data as either a yes or no (lightswitch); yes it should do this or no it should not

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does the = operator mean in JavaScript?

A

Assignment operator; Assign a value to a variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do you update the value of a variable?

A

Using the assignment operator

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the difference between null and undefined?

A

Undefined is a type while null is an object; Undefined is a variable that has been declared but the value has not

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Why is it a good habit to include “labels” when you log values to the browser console?

A

To help keep track of what you are console logging

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Give five examples of JavaScript primitives.

A

String, number, undefined, null, boolean

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What data type is returned by an arithmetic operation?

A

Numbers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is string concatenation?

A

Combining two strings

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What purpose(s) does the + plus operator serve in JavaScript?

A

To add numbers and concatenate strings

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What data type is returned by comparing two values (, ===, etc)?

A

boolean

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What does the += “plus-equals” operator do?

A

Concatenates and assigns the new value to the original variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What are objects used for?

A

To store properties and their values. They are meant to model real world objects.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What are object properties?

A

They tell us about the object (such as the name of a hotel)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Describe object literal notation.

A
You create an object by defining the key value pairs and assign it to a variable
var student = {
name = Shawn
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

How do you remove a property from an object?

A

Using the delete operator

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What are the two ways to get or update the value of a property?

A

Dot notation & Bracket notation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What are arrays used for?

A

Lists

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Describe array literal notation.
Using the square brackets
26
How are arrays different from "plain" objects?
Arrays are indexed numerically
27
What number represents the first index of an array?
0
28
What is the length property of an array?
Shows you numerically the length of the array
29
How do you calculate the last index of an array?
arrayName.length - 1
30
What is a function in JavaScript?
Combining multiple lines of code into a function for ease of access and readability
31
Describe the parts of a function definition.
The function keyword along with an optional name and a parameter surrounded by parenthesis and then an opening and closing curly brace
32
Describe the parts of a function call.
The functions name with an argument surrounded by parenthesis
33
When comparing them side-by-side, what are the differences between a function call and a function definition?
The parameter becomes an argument and you don't need the curly braces
34
What is the difference between a parameter and an argument?
A parameter is defined with the function, while an argument is passes when calling a function
35
Why are function parameters useful?
To store and pass data and provide extra information about the function
36
What two effects does a return statement have on the behavior of a function?
Causes the code block within the function to be ran, and prevents more code from being run.
37
Why do we log things to the console?
So we can see what's actually happening with our code.
38
What is a method?
A method is a function which is a property of an object.
39
How is a method different from any other function?
A method is associated with an object
40
How do you remove the last element from an array?
Pop method
41
How do you round a number down to the nearest integer?
Round method
42
How do you generate a random number?
Math.random method
43
How do you delete an element from an array?
Splice method
44
How do you append an element to an array?
Push method
45
How do you break a string up into an array?
Split method
46
Do string methods change the original string? How would you check if you weren't sure?
No; console log
47
Roughly how many string methods are there according to the MDN Web docs?
50
48
Is the return value of a function or method useful in every situation?
No
49
Roughly how many array methods are there according to the MDN Web docs?
37
50
What three-letter acronym should you always include in your Google search about a JavaScript method or CSS property?
MDN
51
Give 6 examples of comparison operators.
>; =; <=; ===; !===
52
What data type do comparison expressions evaluate to?
Boolean
53
What is the purpose of an if statement?
To make decisions on which code to run
54
Is else required in order to use an if statement?
No
55
Describe the syntax (structure) of an if statement.
Keyword, then condition, then opening curly brace, the code you want to run, and then a closing curly brace.
56
What are the three logical operators?
&&; ||; ! (and, or, logical not)
57
How do you compare two different expressions in the same condition?
Logical operators
58
What is the purpose of a loop?
To keep checking conditions until a statement is true.
59
What is the purpose of a condition expression in a loop?
Setting how long the loop should run
60
What does "iteration" mean in the context of loops?
Each time a loop runs
61
When does the condition expression of a while loop get evaluated?
Before the statement is executed
62
When does the initialization expression of a for loop get evaluated?
Before the condition
63
When does the condition expression of a for loop get evaluated?
After the initialization and before the final-expression
64
When does the final expression of a for loop get evaluated?
After the condition
65
Besides a return statement, which exits its entire function block, which keyword exits a loop before its condition expression evaluates to false?
Break
66
What does the ++ increment operator do?
Increase by 1
67
How do you iterate through the keys of an object?
For-in loops
68
Why do we log things to the console?
So we can see what's actually happening.
69
What is a "model"?
A recreation of something
70
Which "document" is being referred to in the phrase Document Object Model?
The current html document you are working on
71
What is the word "object" referring to in the phrase Document Object Model?
Represents the different objects within the DOM
72
What is a DOM Tree?
A model of a web page
73
Give two examples of document methods that retrieve a single element from the DOM.
getElementById() and querySelector()
74
Give one example of a document method that retrieves multiple elements from the DOM at once.
querySelectorAll()
75
Why might you want to assign the return value of a DOM query to a variable?
To store the location of the element. This way the DOM doesn't have to search through the DOM Tree.
76
What console method allows you to inspect the properties of a DOM element object?
console.dir()
77
Why would a tag need to be placed at the bottom of the HTML content instead of at the top?
It needs to be loaded after all the HTML content
78
What does document.querySelector() take as its argument and what does it return?
It takes a css selector and returns only the first of the matching elements
79
What does document.querySelectorAll() take as its argument and what does it return?
It takes a css selector and returns all elements that match
80
Why do we log things to the console?
To see what data is being passed
81
What is the purpose of events and event handling?
To run code based off of things that happen on the web page
82
What do [] square brackets mean in function and method syntax documentation?
It means the argument is optional
83
What method of element objects lets you set up a function to be called when a specific type of event occurs?
addEventListener
84
What is a callback function?
A function passed into another function as an argument
85
What object is passed into an event listener callback when the event fires?
The event object
86
What is the event.target? If you weren't sure, how would you check? Where could you get more information about it?
The place where the event is being invoked, and in the debugger.
87
What is the difference between these two snippets of code? element. addEventListener('click', handleClick) element. addEventListener('click', handleClick())
The second one will run as soon as it hits the line of code, instead of when the event occurs
88
What is the className property of element objects?
the string within the class attribute
89
How do you update the CSS class attribute of an element using JavaScript?
Using the className property
90
What is the textContent property of element objects?
the text content of the node and its decendants
91
Is the event parameter of an event listener callback always useful?
Useful but not necessary
92
Would this assignment be simpler or more complicated if we didn't use a variable to keep track of the number of clicks?
Harder
93
Why is storing information about a program in variables better than only storing it in the DOM?
So you can access it again quickly and so you don't depend on the DOM.
94
How do you update the text within an element?
Select the element and use the textContent property
95
What event is fired when a user places their cursor in a form control?
Focus
96
What event is fired when a user's cursor leaves a form control?
Blur
97
What event is fired as a user changes the value of a form control?
Input
98
What event is fired when a user clicks the "submit" button within a ?
Submit
99
What does the event.preventDefault() method do?
Prevents the default event of whatever it's in
100
What does submitting a form without event.preventDefault() do?
Reloads the page after you submit
101
What property of a form element object contains all of the form's controls.
.elements property
102
What property of a form control object gets and sets its value?
.value property
103
What is one risk of writing a lot of code without checking to see if it works so far?
It makes it a lot harder to debug
104
What is an advantage of having your console open when writing a JavaScript program?
You can see what's happening at all times
105
Does the document.createElement() method insert a new element into the page?
No
106
How do you add an element as a child to another element?
appendChild() method
107
What do you pass as the arguments to the element.setAttribute() method?
The attribute name then the value
108
What steps do you need to take in order to insert a new element into the page?
Create the element, give it content, and add it to the dom
109
What is the textContent property of an element object for?
To change the text content of that element
110
Name two ways to set the class attribute of a DOM element.
setAttribute() and className() methods
111
What are two advantages of defining a function to do create something (like the work of creating a DOM tree)?
You can reuse the function later & so you don't repeat yourself
112
What is the event.target?
The element interacted with during an event
113
Why is it possible to listen for events on one element that actually happen its descendent elements?
Event flow makes it possible. You are clicking on an element that is within another element (event bubbling)
114
What DOM element property tells you what type of element it is?
tagName
115
What does the element.closest() method take as its argument and what does it return?
It takes the selector and returns itself or the closest element to the selector
116
How can you remove an element from the DOM?
The remove method. element.remove()
117
If you wanted to insert new clickable DOM elements into the page using JavaScript, how could you avoid adding an event listener to every new element individually?
Add an event listener to the parent element
118
What is the event.target?
The element interacted with during an event
119
What is the affect of setting an element to display: none?
The document renders as if the element doesn't exist
120
What does the element.matches() method take as an argument and what does it return?
It takes a selector, and returns a boolean
121
How can you retrieve the value of an element's attribute?
getAttribute()
122
At what steps of the solution would it be helpful to log things to the console?
All steps
123
If you were to add another tab and view to your HTML, but you didn't use event delegation, how would your JavaScript code be written instead?
Multiple event listeners
124
If you didn't use a loop to conditionally show or hide the views in the page, how would your JavaScript code be written instead?
Multiple conditional statements
125
What is JSON?
Text-based data format following JavaScript object syntax
126
What are serialization and deserialization?
Deserialization is when you convert a string to a native object, and serialization is when you convert an object to a string.
127
Why are serialization and deserialization useful?
It allows us to transmit data
128
How do you serialize a data structure into a JSON string using JavaScript?
Stringify
129
How do you deserialize a JSON string into a data structure using JavaScript?
Parse
130
How to you store data in localStorage?
setItem() method
131
How to you retrieve data from localStorage?
getItem() method
132
What data type can localStorage save in the browser?
String
133
When does the 'beforeunload' event fire on the window object?
Before everything is dumped out of the memory from the browser.
134
What is a method?
A function which is a property of an object.
135
How can you tell the difference between a method definition and a method call?
A method definition is when you give a method functionality whereas a method call you are returning the functionality of that property onto an object.
136
Describe method definition syntax (structure).
You define a method like you would an object property and then give it the function to run whatever code you want.
137
Describe method call syntax (structure).
object.Method(). You attach the method to the object and return the result.
138
How is a method different from any other function?
A method is a property of an object
139
What is the defining characteristic of Object-Oriented Programming?
objects can contain both data (as properties) and behavior (as methods).
140
What are the four "principles" of Object-Oriented Programming?
Abstraction, Encapsulation, Inheritance, Polymorphism
141
What is "abstraction"?
Being able to work with possibly complex things in simple ways.
142
What does API stand for?
Application programming interface
143
What is the purpose of an API?
Give programmers a way to interact with a system in a simplified, consistent fashion
144
What is this in JavaScript?
this is an implicit parameter of all JavaScript functions.
145
What does it mean to say that this is an "implicit parameter"?
that it is available in a function's code block even though it was never included in the function's parameter list or declared with var.
146
When is the value of this determined in a function; call time or definition time?
call time
147
``` What does this refer to in the following code snippet? var character = { firstName: 'Mario', greet: function () { var message = 'It\'s-a-me, ' + this.firstName + '!'; console.log(message); } }; ```
The character object
148
Given the above character object, what is the result of the following code snippet? Why? character.greet();
It returns the message variable because it runs the greet method because the greet method is being called on the character object,
149
``` Given the above character object, what is the result of the following code snippet? Why? var hello = character.greet; hello(); ```
It returns the message + undefined because this.firstName isn't defined within the variable hello. This keyword is now attached to hello rather than the firstName property of the character object.
150
How can you tell what the value of this will be for a particular function or method definition?
By default it will refer to the object in which it was created
151
How can you tell what the value of this is for a particular function or method call?
To whatever object calls the function
152
What kind of inheritance does the JavaScript programming language use?
prototype-based or prototypal
153
What is a prototype in JavaScript?
a JavaScript prototype is simply an object that contains properties and (predominantly) methods that can be used by other objects.
154
How is it possible to call methods on strings, arrays, and numbers even though those methods don't actually exist on objects, arrays, and numbers?
Those methods are defined on a "prototype" object and arrays simply borrow those methods when they're needed.
155
If an object does not have it's own property or method by a given key, where does JavaScript look for it?
The prototype chain
156
What does the new operator do?
Creates a blank, plain JavaScript object; Links (sets the constructor of) the newly created object to another object by setting the other object as its parent prototype; Passes the newly created object from Step 1 as the this context; Returns this if the function doesn't return an object.
157
What property of JavaScript functions can store shared behavior for instances created with new?
Prototype
158
What does the instanceof operator do?
Tests to see if the prototype property of a constructor appears anywhere in the prototype chain of an object. The return value is a boolean value.
159
What is a "callback" function?
A callback function is a function passed into another function as an argument, which is then invoked inside the outer function to complete some kind of routine or action.
160
Besides adding an event listener callback function to an element or the document, what is one way to delay the execution of a JavaScript function until some point in the future?
setTimeout()
161
How can you set up a function to be called repeatedly without using a loop?
setInterval()
162
What is the default time delay if you omit the delay parameter from setTimeout() or setInterval()?
0
163
What do setTimeout() and setInterval() return?
A timeout or interval ID which is an integer
164
What is a code block? What are some examples of a code block?
Grouped statements within a curly brace, if else, for, while
165
What does block scope mean?
It refers to the lines of code within the code block
166
What is the scope of a variable declared with const or let?
Block scope
167
What is the difference between let and const?
You can reassign values to variables with let, while you can't do that with const
168
Why is it possible to .push() a new value into a const variable that points to an Array?
Because you're adding to the array rather than re-assigning or re-declaring
169
How should you decide on which type of declaration to use?
You should use const unless you need to reassign the variable later
170
What is destructuring, conceptually?
Unpacking values into variables
171
What is the syntax for Object destructuring?
const {name, name, name} = objectVariable
172
What is the syntax for Array destructuring?
const [name, name, name] = arrayVariable
173
How can you tell the difference between destructuring and creating Object/Array literals?
If it's happening on the left side of the equal sign its destructuring
174
What is the syntax for writing a template literal?
`${variableName}`
175
What is "string interpolation"?
The ability to substitute part of the string for the values of variables or expressions.
176
What is the syntax for defining an arrow function?
const = (p1, p2, ..., pn) => expression or const = (p1,p2,..,pn) => {}
177
When an arrow function's body is left without curly braces, what changes in its functionality?
It doesn't need a return statement
178
How is the value of this determined within an arrow function?
This will be referring to the enclosing context, rather than creating its own context within the function
179
What is a CLI?
Command line interface
180
What is a GUI?
Graphical user interface
181
man
Brings up the manual in the terminal
182
cat
Print contents of a file in the terminal
183
ls
List contents of a directory/file in the terminal
184
pwd
Shows your working directory in the terminal
185
echo
Add content to a file
186
touch
Creates a new file
187
mkdir
Creates a new directory
188
mv
Rename a directory
189
rm
Remove a file
190
cp
Copy a file
191
What are the three virtues of a great programmer?
Laziness, patience, hubris
192
What is Node.js?
As an asynchronous event-driven JavaScript runtime, Node.js is designed to build scalable network applications.
193
What can Node.js be used for?
back end services
194
What is a REPL?
Read-eval-print-loop; used for single line commands in the terminal
195
When was Node.js created?
2009
196
What back end languages have you heard of?
Node.js, PHP
197
What is a computer process?
An instance of a computer program being executed on one or more threads
198
Roughly how many computer processes are running on your host operating system (Task Manager or Activity Monitor)?
120
199
Why should a full stack Web developer know that computer processes exist?
It's important to know what processes are running at any given time so you can work with them
200
What is the process object in a Node.js program?
The process object is a global that provides information about, and control over, the current Node.js process. As a global, it is always available to Node.js applications without using require().
201
How do you access the process object in a Node.js program?
process
202
What is the data type of process.argv in Node.js?
array
203
What is a JavaScript module?
A single .js file
204
What values are passed into a Node.js module's local scope?
__dirname, __filename, exports, module, require
205
Give two examples of truly global variables in a Node.js program.
global, process
206
What is the purpose of module.exports in a Node.js module?
To transfer information between JavaScript files
207
How do you import functionality into a Node.js module from another Node.js module?
Assign whatever you want to be exported to module.export; Then use require("./fileName") in the file where you want to import that information
208
What is the JavaScript Event Loop?
The interaction between the call stack and the callback queue, which checks if the queue is empty or not, and if something is in the queue, it gets pushed to the call stack
209
What is different between "blocking" and "non-blocking" with respect to how code is executed?
Blocking refers to code that is running, which blocks other code from being executed on the webpage until that stack is finished
210
What is a directory?
A file system for storing data on your computer
211
What is a relative file path?
A location that is relative to the current directory
212
What is an absolute file path?
The complete location of the file, including which drive it was on
213
What module does Node.js include for manipulating the file system?
fs
214
What method is available in the Node.js fs module for writing data to a file?
writeFile
215
Are file operations using the fs module synchronous or asynchronous?
asynchronous
216
What is a client?
A piece of computer hardware or software that interacts with a server.
217
What is a server?
A piece of computer hardware or software that provides functionality for clients.
218
Which HTTP method does a browser issue to a web server when you visit a URL?
GET
219
What is on the first line of an HTTP request message?
An HTTP method, request target, and the HTTP version
220
What is on the first line of an HTTP response message?
The protocol version, a status code, a status text
221
What are HTTP headers?
HTTP headers let the client and the server pass additional information with an HTTP request or response. An HTTP header consists of its case-insensitive name followed by a colon (:), then by its value.
222
Is a body required for a valid HTTP message?
No
223
What is AJAX?
Ajax allows you to update parts of the DOM of an HTML page instead without the need for a full page refresh. Ajax also lets you work asynchronously, meaning your code continues to run while the targeted part of your web page is trying to reload (compared to synchronously, which blocks your code from running until that part of your page is done reloading).
224
What does the AJAX acronym stand for?
Asynchronous JavaScript And XML
225
Which object is built into the browser for making HTTP requests in JavaScript?
XMLHttpRequest
226
What event is fired by XMLHttpRequest objects when they are finished loading the data from the server?
load
227
What is NPM?
A software registry that allows users to share and borrow packages
228
What is a package?
Reusable code from other users that uploaded them to the npm website
229
How can you create a package.json with npm?
You navigate to the directory and then run npm init --yes
230
What is a dependency and how to you add one to a package?
The packages installed by the user and required for the project npm install package name
231
What happens when you add a dependency to a package with npm?
The package is added to a node_modules folder
232
How do you add express to your package dependencies?
npm install express
233
What Express application method starts the server and binds it to a network PORT?
listen()
234
What is the appropriate Content-Type header for HTTP messages that contain JSON in their bodies?
application/json
235
What is the significance of an HTTP request's method?
It indicates the desired action for the server to take
236
What does the express.json() middleware do and when would you need it?
It parses incoming requests with JSON payloads; Whenever you use a post request, since you are sending data to the server
237
What is Array.prototype.filter useful for?
It is useful for creating a new array when you only want to grab specific values from an existing array that meet a specific condition
238
What is Array.prototype.map useful for?
when you want to run a function on every index in the array and return the same amount of values as the input array
239
What is Array.prototype.reduce useful for?
When you want to run a function on every index in the array and return a single value
240
What is "syntactic sugar"?
syntactic sugar is syntax within a programming language that is designed to make things easier to read or to express.
241
What is the typeof an ES6 class?
Function
242
Describe ES6 class syntax.
You define a class, and inside that class you define a constructor function where you pass the parameters you're expecting, and then you can define multiple methods that you would want to run on that class
243
What is "refactoring"?
Rewriting code to make it more readable, while still maintaining the same functionality
244
What is Webpack?
A module bundler
245
How do you add a devDependency to a package?
npm install --save-dev
246
What is an NPM script?
an npm command that you define, that when called runs whatever you assigned to the script
247
How do you execute Webpack with npm run?
npm run scriptName
248
How are ES Modules different from CommonJS modules?
Their syntax is even more compact than CommonJS’s. Their structure can be statically analyzed (for static checking, optimization, etc.). Their support for cyclic dependencies is better than CommonJS’s.
249
What kind of modules can Webpack support?
ES, CommonJS, AMD
250
What is React?
React is a declarative, efficient, and flexible JavaScript library for building user interfaces.
251
What is a React element?
Plain objects you create where you specific the element and value, that can be rendered into the DOM
252
How do you mount a React element to the DOM?
ReactDOM.render(element, container[, callback])
253
What is Babel?
babel is a toolchain that is mainly used to convert ECMAScript 2015+ code into a backwards compatible version of JavaScript in current and older browsers or environments. It also converts JSX
254
What is a Plug-in?
a software component that adds a specific feature to an existing computer program.
255
What is a Webpack loader?
loaders allow you to specify which files you want a specific dependency to run on before webpack compiles your files
256
How can you make Babel and Webpack work together?
You configure webpack to specify which files you want Babel to transpile before webpack compiles all your files
257
What is JSX?
A nice and readable way of creating elements in React
258
Why must the React object be imported when authoring JSX in a module?
You need to import react and react-dom in order to create DOM elements in React
259
How can you make Webpack and Babel work together to convert JSX into valid JavaScript?
Using a babel-loader along with a babel plugin to convert JSX
260
What is a React component?
Pieces of reusable code
261
How do you define a function component in React?
``` defining a function or a class; function Welcome() { return

Hello

; }; class Welcome extends React.Component { render() { return

Hello

; } } ```
262
How do you mount a component to the DOM?
ReactDOM.render( , document.getElementById('root') );
263
What are props in React?
objects which are used to pass data between components
264
How do you pass props to a component?
props as a parameter in your function/class
265
How do you write JavaScript expressions in JSX?
in curly braces
266
How do you create "class" component in React?
class ClassName extends React.Component
267
How do you access props in a class component?
this
268
What is the purpose of state in React?
to control what you want the user to see on the webpage
269
How to you pass an event handler to a React element?
onClick attribute or different event attributes
270
What Array method is commonly used to create a list of React elements?
map
271
What is the best value to use as a "key" prop when rendering lists?
Ids or a unique string
272
What are controlled components?
An input form element whose value is controlled by state
273
What two props must you pass to an input for it to be "controlled"?
handle submit & handle change
274
What does express.static() return?
a function
275
What is the local __dirname variable in a Node.js module?
the directory name of the current module
276
What does the join() method of Node's path module do?
It combines all its arguments to make a path
277
What does fetch() return?
a promise
278
What is the default request method used by fetch()?
get
279
How do you specify the request method (GET, POST, etc.) when calling fetch?
you define the desired method inside of the init object within your fetch call
280
When does React call a component's componentDidMount method?
After a component was rendered
281
Name three React.Component lifecycle methods.
componentWillUnmount componentDidUpdate, componentDidMount
282
How do you pass data to a child component?
props
283
What must the return value of myFunction be if the following expression is possible? myFunction()();
another function
284
``` What does this code do? const wrap = value => () => value; ```
A function that returns another function which returns the parameter from the 1st function
285
What allows JavaScript functions to "remember" values from their surroundings?
closures