Study Cards Flashcards
Where do you put non-visible content about the HTML document?
In the head element.
Where do you put visible content about the HTML document?
In the body element.
Where do the head and body tags go in a valid HTML document?
In the html element.
What is the purpose of a !DOCTYPE declaration?
To instruct the web browser what document type to expect.
What is the purpose of HTML attributes?
To provide additional information about the contents of an element.
How do block-level elements affect the document flow?
Always appear on a new line, and take up the entire horizontal space of their parent element.
How do inline elements affect the document flow?
Continue on the same line as neighboring elements.
What are the default width and height of a block-level element?
Width: Entire horizontal space of its parent element.
Height: Height of its contents.
What are the default width and height of an inline element?
The width and height of its contents.
What is the difference between an ordered list and an unordered list in HTML?
Ordered list items are numbered, unordered list items are not.
Is an HTML list a block element or an inline element?
Block.
What HTML tag is used to link to another website?
a tag
What is an absolute URL?
The full web address.
What is a relative URL?
A shorthand link address for a page within the same site.
How do you indicate the relative link to a parent directory?
../
How do you indicate the relative link to a child directory?
The name of the directory.
How do you indicate the relative link to a grand parent directory?
../../
How do you indicate the link to the same directory?
Simply use the name of the target file.
What is the purpose of an HTML form element?
To allow users to submit data.
Give five examples of form control elements.
buttons, checkboxes, radio buttons, text input, select lists
Give three examples of type attributes for HTML < input > elements.
text, email, password, radio, checkbox, submit
Is an HTML < input > element a block or inline element?
inline
What are the six primary HTML elements for creating tables?
< table >, < thead >, < tbody >, < tr >, < th >, < td >
What purpose do the thead and tbody elements serve?
Differentiate between the headers and the general table data.
Give two examples of data that would lend itself well to being displayed in a table.
Stocks, sports statistics, etc.
What are the names of the individual pieces of a CSS rule?
Selector, curly braces which define the declaration block, and property/value pairs.
In CSS, how do you select elements by their class attribute?
With a .classname
In CSS, how do you select elements by their type?
The name of the element
In CSS, how do you select an element by its id attribute?
With a #idname
Name three different types of values you can use to specify colors in CSS.
Color names, RGB values, HEX codes
What CSS properties make up the box model?
Content, padding, border, and margin.
Which CSS property pushes boxes away from each other?
Margin
Which CSS property adds space between a box’s content and its border?
Padding
What is a pseudo-class?
A keyword added to a selector that specifies a special state of the selected element(s), like :hover or :visited
What are pseudo-classes useful for?
Allow you to apply style not just to the content, but in relation to the status of content items, like :hover, :visited, :checked etc.
What CSS property controls the font used for the text inside an element?
font-family
What is the default flex-direction of a flex container?
row
What is the default flex-wrap of a flex container?
no-wrap
Why do two div elements “vertically stack” on one another by default?
They are block level elements by default
What is the default flex-direction of an element with display: flex?
row
What is the default value for the position property of HTML elements?
static
How does setting position: relative on an element affect document flow?
It doesn’t
How does setting position: relative on an element affect where it appears on the page?
It doesn’t
How does setting position: absolute on an element affect document flow?
It removes the element from the document flow.
How does setting position: absolute on an element affect where it appears on the page?
The element will be positioned relative to its first non-static parent element (usually with a position: relative)
What is the main purpose of using position: absolute?
Layering elements on top of other elements.
How do you constrain an absolutely positioned element to a containing block?
Give a parent element a position: relative
What are the four box offset properties?
top, bottom, left, right
What is the purpose of variables?
To store data for later use.
How do you declare a variable?
const or let variableName = value;
How do you initialize (assign a value to) a variable?
with const or let keyword variableName = value
What characters are allowed in variable names?
Letter, number, underscore. The first character CANNOT be a number.
What does it mean to say that variable names are “case sensitive”?
References to a variable must be made using the identical case/capitalization as the variable declaration.
What is the purpose of a string?
To hold data that can be represented in text form.
What is the purpose of a number?
To save a number to be used in mathematical calculation.
What is the purpose of a boolean?
Useful when the data can only have two possible values, true or false.
What does the = operator mean in JavaScript?
assignment
How do you update the value of a variable?
variableName = newValue; (var keyword only to be used during initial variable creation)
What is the difference between null and undefined?
null is an empty value, undefined means no value has been assigned
Why is it a good habit to include “labels” when you log values to the browser console?
Clarifies what data is being logged to the console.
Give five examples of JavaScript primitives
string, number, boolean, null, undefined
What data type is returned by an arithmetic operation?
number
What is string concatenation?
appending one string to the end of another string
What purpose(s) does the + plus operator serve in JavaScript?
addition operator and concatenation operator
What data type is returned by comparing two values (greater than/less than operator, ===, etc)?
Boolean
What does the += “plus-equals” operator do?
Adds the provided value to a variable
What are objects used for?
Holding data in the form of multiple properties split into key-value pairs.
What are object properties?
Data held within objects in the form of key-value pairs
Describe object literal notation.
A set of curly braces with key-value pairs contained within
How do you remove a property from an object?
with the delete operator (delete objectName.propertyName)
What are two ways to get or update the value of a property?
Dot notation (objectName.propertyName) (preferred) and bracket notation (objectName[“propertyName”])
What are arrays used for?
Holding lists of related data in an ordered format.
Describe array literal notation.
A set of brackets with values separated by commas.
How are arrays different from “plain” objects?
They are ordered, and contain values at numbered indexes rather than key-value pairs
What number represents the first index of an array?
0
What is the length property of an array?
Determines the number of values contained in the array
How do you calculate the last index of an array?
array.length - 1
What is a function in JavaScript?
A set of “instructions”, whose code can be saved and called for later use
Describe the parts of a function definition.
The function keyword, the function name (optional), parameters in parentheses (optional), and the code block contained by curly braces. Often a return statement is included in the code block.
Describe the parts of a function call.
The name of the function and parentheses, as well as any arguments in the parentheses if necessary
When comparing them side-by-side, what are the differences between a function call and a function definition?
Function definition includes function keyword and code block, which are not used in function call
What is the difference between a parameter and an argument?
Parameter is a placeholder used in a function definition, argument is the actual data passed to the function in a function call.
Why are function parameters useful?
Allows us to pass different data to functions, to use the same function to perform different tasks.
What two effects does a return statement have on the behavior of the function?
The function will produce a value, and prevents any more code in the function’s code block from being run.
Why do we log things to the console?
To check our work during the development phase
What is a method?
A function which is a property of an object
How is a method different from any other function?
A method is a function which is a property of an object, rather than just a free-floating function
How do you remove the last element from an array?
the .pop() method
How do you round a number down to the nearest integer?
the Math.floor() method
How do you generate a random number?
the Math.random() method
How do you delete an element from an array?
.unshift() will remove an element from the beginning of an array;
.pop() will remove an element from the end of an array;
.splice() can remove an element from a specified index of an array
How do you append an element to an array?
.shift() will add an element to the beginning of an array;
.push() will add an element to the end of an array;
.splice() can add an element to a specified index of an array
How do you break a string up into an array?
the .split() method
Is the return value of a function or method useful in every situation?
No, sometimes the return value is not needed
What three-letter acronym should you always include in your Google search about a JavaScript method or CSS property?
MDN
Give 6 examples of comparison operators?
Equal, strictly equal, not equal, strictly not equal, less than, greater than, less than or equal to, greater than or equal to
What data type do comparison expressions evaluate to?
Boolean
What is the purpose of an if statement?
To determine whether or not to run code based on a condition
Is else required in order to use an if statement?
No
Describe the syntax of an if statement
if (condition) {
}
What are three logical operators?
and (&&), or (||), and not (!)
What is the purpose of a loop?
To require code to be repeated
What is the purpose of a condition expression in a loop?
Determine whether or not the code should be run again
What does “iteration” mean in the context of loops?
Each time the loop is run, ie every time the condition is tested, the code is run, and the final expression is executed
When does the condition expression of a while loop get evaluated?
Every iteration before the code block is run
When does the initialization expression for a for loop get evaluated?
At the beginning of the for loop, the first time the loop is run
When does the condition expression for a for loop get evaluated?
After the initialization, and on every iteration before the code block is run
When does the final expression of a for loop get evaluated?
Every iteration after the code block is run, and before the condition is evaluated
Besides a return statement, which exits its entire function block, which keyword exits a loop before its condition expression evaluates to false?
break
What does the ++ increment operator do?
Increases the value of the variable by 1
How do you iterate through the keys of an object?
for…in loop
What are the 4 components of the CSS cascade?
source order, inheritance, specificity, and !important
What does the term “source order” mean with respect to CSS?
The styling provided for an element LAST in the stylesheet is the styling that will be applied
How is it possible for the styles of an element to be applied to its children as well without an additional CSS rule?
Inheritance
List the three selector types in order of increasing specificity
element, class, id
Why is using !important considered bad practice?
It overrides other declarations and breaks the natural cascading of stylesheets
Why do we log things to the console?
To show data of what our code is doing for use in the development phase.
Which “document” is being referred to in the phrase Document Object Model?
The actual html page that is being modeled in JavaScript
What is the word “object” referring to in the phrase Document Object Model?
A JavaScript object, which is being used to model the html document
What is a DOM Tree?
The model of the web page with parent/child relationships, created by the DOM.
Give two examples of document methods that retrieve a SINGLE element from the DOM
.querySelector(), .getElementById()
Give one example of a document method that retrieves multiple elements from the DOM at once
.querySelectorAll()
Why might you want to assign the return value of a DOM query to a variable?
Makes it easier to access that DOM query later.
What console method allows you to inspect the properties of a DOM element object?
console.dir()
Why would a script tag need to be placed at the bottom of the HTML content instead of at the top?
So the code before it will run, which will allow us to make changes to that code in the .js file referenced by our script tag
What does document.querySelector() take as its argument and what does it return?
It takes a CSS selector as its argument, and returns the FIRST element that matches that description
What does document.querySelectorAll() take as its argument and what does it return?
It takes a CSS selector as its argument, and returns ALL elements that match that description
What is the purpose of events and event handling?
To allow JavaScript to make changes when a user interacts with the page
What do [ ] square brackets mean in function and method syntax documentation?
Optional
What method of element objects lets you set up a function to be called when a specific type of event occurs?
.addEventListener()
What is a callback function?
A previously defined function that is used later in the code
What object is passed into an event listener callback when the event fires?
The event
What is the event.target?
The object on which the event is occuring
What is the className property of element objects?
allows us to access or change the class of an element
How do you update the CSS class attribute of an element using JavaScript?
.className property
What is the textContent property of element objects?
allows us to access or change the text content of an element
How do you update the text within an element using JavaScript?
.textContent property
Is the event parameter of an event listener callback always useful?
No, sometimes it is not needed in the callback function
What does the CSS transform property do?
Changes how an element is displayed visually (including translate(), scale(), rotate(), skew(), and matrix() )
The transition property is shorthand for which four CSS properties?
transition-property, transition-duration, transition-timing-function, and transition-delay
What event is fired when a user places their cursor in a form control?
focus
What event is fired when a user’s cursor leaves a form control?
blur
What is fired as a user changes the value of a form control?
input
What event is fired when a user clicks the “submit” button within a form?
submit
What does the event.preventDefault() method do?
Prevents the browser from refreshing
What property of a form element object contains all of the form’s controls?
elements
What property of a form control object gets and sets its value?
value
What is one risk of writing a lot of code without checking to see if it works so far?
The more code you write without checking, the more code you will have to check through to see where the error is coming from.
What is an advantage of having your console open when writing a JavaScript program?
You can check your code as you go
Does the document.createElement() method insert a new element into the page?
No, it only creates the element in JavaScript, it needs to be inserted into the page with a method such as appendChild()
How do you add an element as a child to another element?
appendChild() method
What do you pass as the arguments to the element.setAttribute() method?
(‘attributename’, ‘value’)
What steps do you need to take in order to insert a new element into the page?
Create the element with something like createElement(), insert with something like appendChild()
What is the textContent property of an element object for?
getting and setting the text content of an element
Name two way to set the class attribute of a DOM element
setAttribute() method and className property
What are the advantages of defining a function to create something (like the work of creating a DOM tree)?
It is reusable and makes grouping/structure more clean and logical
Give two examples of media features that you can query in a @media rule
width, height, resolution, orientation, aspect-ratio, many more…
Which HTML meta tag is used in mobile-responsive web pages?
Why is it possible to listen for events on one element that actually happen on its descendent elements?
Bubbling. By default events “bubble”, or propagate through the chain of their ancestor elements
What DOM element property tells you what type of element it is?
event.target.tagName
What does the element.closest() method take as its argument and what does it return?
It takes a selector as its argument and returns the closest ancestor element matching that criteria
How can you remove an element from the DOM?
remove()
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?
Target a parent containing element and utilize DOM event delegation
What is the effect of setting an element to display: none?
It is completely removed from the page and document flow, as if it did not exist
What does the element.matches() method take as an argument and what does it return?
It takes a selector as its argument and returns a boolean indicating whether or not it is a match
How can you retrieve the value of an element’s attribute?
getAttribute()
What is a breakpoint in responsive Web design?
The size at which a website’s style properties will change to adapt to the screen size
What is the advantage of using a percentage width instead of a fixed width for a “column” class in a responsive layout?
The percentage is relative and will resize based on the size of the browser window
If you introduce CSS rules for a smaller min-width after the styles for a larger min-width in your style sheet, the CSS rules for the smaller min-width will “win”. Why is that?
Because of the Source-Order of CSS
What is JSON?
a text-based data format following JavaScript object syntax
What are serialization and deserialization?
Converting data (objects, etc) into bytes (a string in the case of JSON) to be transmitted
How do you serialize a data structure into a JSON string using JavaScript?
.stringify() method
How do you deserialize a JSON string into a data structure using JavaScript?
.parse() method
What method do you use to store data in localStorage?
.setItem()
What method do you use to retrieve data in localStorage?
.getItem()
What data type can localStorage save in the browser?
string
When does the ‘beforeunload’ event fire on the window object?
When the page is refreshed, closed, or unloaded in some way
What is a method?
A function that is a property of an object
How can you tell the difference between a method definition and a method call?
A method call will include .methodname()
What is the defining characteristic of Object-Oriented Programming (OOP)?
objects can contain both data (as properties) and behavior (as methods)
What is abstraction?
being able to work with (possibly) complex things in simple ways
What does API stand for?
application programming interface
What is the purpose of an API?
defines interactions between multiple software intermediaries. A set of rules that allow programs to talk to each other
What is ‘this’ in JavaScript?
An implicit parameter of an object
What does it mean to say that this is an “implicit parameter”?
it is available in a function’s code block even though it was never included in the function’s parameter list or declared
When is the value of this determined in a function; call time or definition time?
call time
How can you tell what the value of this is for a particular function or method call?
The object to the left of the dot
What kind of inheritance does the JavaScript programming language use?
Prototype-based inheritance
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?
With prototypes
If an object does not have it’s own property or method by a given key, where does JavaScript look for it?
In the prototype object
What does the new operator do?
Create a new instance of the object type specified by the constructor function
What property of JavaScript functions can store shared behavior for instances created with new?
prototype
What does the instanceof operator do?
Determines whether the specified object is an instance of the specified constructor. Returns a boolean value.
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()
How can you set up a function to be called repeatedly without using a loop?
setInterval()
What is the default time delay if you omit the delay parameter from setTimeout() or setInterval()?
0 (execute immediately)
What do setTimeout() and setInterval() return?
The timer ID (a positive integer). Can be passed to clearTimeout() to cancel the timer
What is a code block? What are some examples?
The code contained within a set of curly braces in a function, if statement, loop
What does block scope mean?
A block scope variable can only be accessed in the code block where it is declared
What is the scope of a variable declared with const or let?
Block scope
What is the difference between let and const?
let can be reassigned, const cannot
Why is it possible to .push() a new value into a const variable that points to an array?
Because in a const variable, the value cannot be reassigned but if the value is an object or an array, it can be mutated
How should you decide which type of variable declaration to use?
const unless a variable will need to be reassigned, then use let
What is destructuring, conceptually?
Makes it possible to unpack values from arrays, or properties from objects, into distinct variables
What is the syntax for object destructuring?
const { property1, property2 } = objectName
What is the syntax for array destructuring?
const [ element1, element2 ] = arrayName
How can you tell the difference between destructuring and creating object/array literals?
By identifying which side of the assignment operator the braces/brackets are on
What is the syntax for writing a template literal?
Surround in backticks (``), javascript expressions contained in ${}
What is string interpolation?
Replacing placeholders with values in a string literal
What is the syntax for defining an arrow function?
(parameter1, parameter2) => { code block }
When an arrow function’s body is left without curly braces, what changes in its functionality?
The function will automatically return the result of the expression to the right of the arrow
How is the value of ‘this’ determined within an arrow function?
It derives the value of ‘this’ from the scope where it was created
What is Node.js?
An asynchronous event-driven JS runtime, which allows JS to be run outside of a web browser
What can Node.js be used for?
To build back ends for web apps, command-line programs, or develop other automation
What is a REPL?
Read-eval-print loop
What is a CLI?
Command line interface
What is a GUI?
Graphical user interface
What is a computer process?
An instance of a computer program that is being executed
What is the process object in a Node.js program?
A global object the provides info and control over the current Node.js process
How do you access the process object in a Node.js program?
It is a global object, so using “process”
What is the data type of process.argv in Node.js
Array
What is a JavaScript module?
A single JavaScript file
What values are passed into a Node.js module’s global scope?
exports, module, require(), __dirname, __filename
What is the purpose of module.exports in a Node.js module?
To access a module’s code from a different module
How do you import functionality into a Node.js module from another Node.js module?
require()
What is the javascript event loop?
Monitors the Call Stack and Callback Queue. When the Stack is empty, it will take the first event from the Queue and push it to the Stack
What is different between blocking and non-blocking with respect to how code is executed?
Blocking is when the execution of additional code must wait until the operation completes
What module does Node.js include for manipulating the file system?
fs
What method is available in the Node.js fs module for writing data to a file?
writeFile()
Are file operations using the fs module synchronous or asynchronous?
There are asynchronous and synchronous operations
Which HTTP method does a browser issue to a web server when you visit a URL?
GET
What is on the first line of an HTTP request message?
The request method (get, post, etc), target, and HTTP standard (HTTP/1.1)
What is on the first line of an HTTP response message?
The HTTP standard (HTTP/1.1), status code, and status message
What are HTTP headers?
Additional information passed with an HTTP request or response
Is a body required for a valid HTTP message?
No
What is npm?
A service comprised of a website, command line interface, and registry of code packages that can be utilized
What is a package?
A directory containing code files, as well as a package.json file.
How can you create a package.json with npm?
npm init –yes
What is a dependency and how do you add one to a package?
A dependency is a package that is required to use another package. You can add one with npm install packagename
What happens when you add a dependency to a package with npm?
The package and all the package’s dependencies are added to the node-modules directory, and the dependency is added to the dependencies object in package.json
How do you add express to your package dependencies?
npm install express
What Express application method starts the server and binds it to a network PORT?
.listen()
How do you mount a middleware with an Express application?
.use()
Which objects does an Express application pass to your middleware to manage the request/response lifecycle of the server?
request and response objects
What is the appropriate Content-Type header for HTTP messages that contain JSON in their bodies?
application/json
What is the significance of an HTTP request’s method?
It is purely semantic, all requests have the same functionality
What does the express.json() middleware do?
Automatically parses incoming requests with JSON
What is PostgreSQL and what are some alternatives?
A relational database. Other relational databases: MySQL, Oracle, Microsoft SQL Server…
What are some advantages of learning a relational database?
Ideal for storing related data. Make data corruption as unlikely as possible.
What is one way to see if PostgreSQL is running?
sudo service postgresql status
What is a database schema?
A collection of tables. Defines how the data in a relational database should be organized
What is a table in a relational database?
A list of rows, each having the same set of attributes
What is a row in a relational database?
An instance of a record
What is SQL and how is it different from languages like JavaScript?
Structured Query Language. Used for managing data in relational databases. Operates through simple, declarative statements.
How do you retrieve specific columns from a database table?
select keyword with columns in double quotes
How do you filter rows based on some specific criteria?
where keyword with comparison operators
What are the benefits of formatting your SQL?
Consistency and readability
What are four SQL comparison operators that can be used in a where clause?
=, , >+, <=, <> (not equal)
How do you limit the number of rows returned in a database result set?
Limit keyword with number
How do you retrieve all columns from a database table?
*
How do you control the sort order of a result set?
order by “”
How do you add a row to a SQL table?
insert into “tablename” (“columns” separated by commas)
values (‘correspondingvalues’ separated by commas)
What is a tuple?
A list of values in SQL
How do you add multiple rows to a SQL table at once?
Specify more than one tuple of values, separated by commas
How do you get back the row being inserted into a table without a separate select statement?
returning *
How do you update rows in a database table?
update “tablename”
set “columnname” = ‘value’
Why is it important to include a where clause in your update statements?
So you don’t update EVERY row in the table
How do you delete rows from a database table?
delete from “tablename”
where “columnname” = ‘value’
How do you accidentally delete all rows from a table?
delete from “tablename”
without specifying a where statement
What is a foreign key?
A table column that refers to values in another table
How do you join two SQL tables?
After from statement, use:
join “tablename” using (“connectioncolumnname”)
How do you temporarily rename columns or tables in a SQL statement?
select “columnname” as “aliasname”
What are some examples of aggregate functions in SQL?
sum(), count(), avg(), max(), min(), every()
What is the purpose of a group by clause in SQL?
Allows you to separate rows into groups and performs aggregate functions on these groups
What are the three states a Promise can be in?
pending, fulfilled, rejected
How do you handle the fulfillment of a Promise?
.then() method, with fulfillment handler function passed in
How do you handle the rejection of a Promise?
.catch() method, with rejection handler function passed in
What is Array.prototype.filter useful for?
Creating a new array with all elements that pass the test in the provided function
What is Array.prototype.map useful for?
Creating a new array with the results of calling a provided function on every element in an array
What is Array.prototype.reduce useful for?
Executes a function on each element of an array, returning a single output value
What is “syntactic sugar”?
Functions the same, but looks better/cleaner
What is the typeof an ES6 class?
Function
Describe ES6 class syntax
class functionName {}
What is “refactoring”?
Restructuring existing code without changing its external behavior, with the intention of improving it
What is Webpack?
A tool to bundle JavaScript applications/modules
How do you add a devDependency to a package?
npm install packagename –save-dev
What is an npm script?
npm scripts can automate repetitive tasks. Located in package.json
How do you execute Webpack with npm run?
Add “build”: “webpack” script in package.json, and use command npm run build
What is React?
A component-based JavaScript library for building interactive user interfaces
What is a React element?
An object created with React.createElement that describes what you will see on the screen.
How do you mount a React element to the DOM?
ReactDOM.render(element, container[, callback])
What is Babel?
A JavaScript compiler used to covert ES6 code into a backwards compatible version of JavaScript
What is a Plug-in?
A software component that adds an additional feature to an existing program
What is a webpack loader?
Transforms source code of a module before they are loaded
How can you make babel and webpack work together?
With babel-loader
What is JSX?
A syntax extension to JavaScript, used with React
Why must the React object be imported when authoring JSX in a module?
When we are using JSX, it is implicitly using React methods.
How can you make Webpack and Babel work together to convert JSX into valid JavaScript?
Use the babel loader and @babel/plugin-transform-react-jsx to convert the JSX to JavaScript when the files are combined into main.js by webpack
What is a React component?
They are reusable bits of code that work in isolation and return HTML via a render function. Either a function or a class
How do you define a function component in React?
function Name(props) { return }
How do you mount a React component to the DOM?
With ReactDOM.render() method
What are props in React?
Properties used for passing data to components
How do you pass props to a component?
By passing the prop as a key value pair when creating a react element
How do you write JavaScript expressions in JSX?
Inside curly braces
How do you create class components in React?
class Name extends React.component {}
How do you access props in a React class component?
this.props
What is the purpose of state in React?
Is is data managed WITHIN a component, can be changed over time and used to make changes within the component
How to you pass an event handler to a React element?
As a prop, prop name is the name of the event in camelCase
What are controlled components in React?
A form element whose value is controlled by React
What two props must you pass to an input for it to be “controlled”?
A value prop with corresponding state property as its value, and an onChange event with corresponding handler function as its value
What Array method is commonly used to create a list of React elements?
map()
What is the best value to use as a “key” prop when rendering lists?
An ID, or a string that uniquely identifies a list item among its siblings
What does express.static() return?
A middleware function
What is the local __dirname variable in a Node.js module?
The directory name of the current module, as a string
What does the join() method of Node’s path module do?
Joins all given path segments together and normalizes the resulting path
What does fetch() return?
A promise that resolves to a response object
What is the default request method used by fetch()?
GET
How do you specify the request method (GET, POST, etc.) when calling fetch?
Include an optional init object as the second argument, and specify the property method: ‘POST’
When does React call a component’s componentDidMount method?
Immediately after a component is initially mounted
Name three React.Component lifecycle methods.
componentDidMount, componentDidUpdate, componentWillUnmount
How do you pass data to a child component in React?
As props