HTML Flashcards

1
Q

Where do you put non-visible content about the HTML document?

A

In the tag

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

Where do you put visible content about the HTML document?

A

In the tag.

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

Where do the and tags go in a valid HTML document?

A

Both are within the tag with coming before .

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

What is the purpose of a declaration?

A

declares the specific language that the code will be in.

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

Give five examples of HTML element types.

A

<p>, </p>

<div></div>

, <img></img>, <h1>, </h1>, head

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

What is the purpose of HTML attributes?

A

They give additional information about the contents of an element.

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

Give an example of an HTML entity (escape character).

A

® ® ““”

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

How do block-level elements affect the document flow?

A

block-level elements appear on new lines in the browser window.

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

How do inline elements affect the document flow?

A

inline elements will appear to continue on the same line as neighboring elements.

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

What are the default width and height of a block-level element?

A

width of 100% the parent container, full width available

length default to whatever height it needs to have depending on content.

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

What are the default width and height of an inline element?

A

Height and width are the exact height and width of the content.

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

What is the difference between an ordered list and an unordered list in HTML?

A

An ordered list will automatically assign numbers to the list elements underneath it. an unordered list uses bullets.

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

What HTML tag is used to link to another website?

A

<a></a> anchor tag

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

What is an absolute URL?

A

web address in the browser to visit a specific page. has domain name and path. links to website other than current one.

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

Is an HTML list a block element or an inline element?

A

Block

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

What is a relative URL?

A

relative url if linking within the same site. has the name of the file or navigation to folder. - no domain name.

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

How do you indicate the relative link to a parent directory?

A

<a></a>

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

How do you indicate the relative link to a child directory?

A

<a></a>

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

How do you indicate the relative link to a grand parent directory?

A

<a></a>

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

How do you indicate the relative link to the same directory?

A

<a></a>

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

What is the purpose of an HTML form element?

A

gather data from clients.

specifies the method and URL for the page on the server that will receive the form information.

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

Give five examples of form control elements.

A

input, label, select, textarea, option

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

Give three examples of type attribute values for HTML input elements.

A

image, submit, file, checkbox

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

Is an HTML input element a block element or an inline element?

A

inline

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

What are the six primary HTML elements for creating tables?

A

Table, thead, tbody, tfoot, th, td

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

What purpose do the thead and tbody elements serve?

A

thead contains the first row of the of the table that has the headings.
tbody contains the content of the tables

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

Give two examples of data that would lend itself well to being displayed in a table.

A

Finance sheets, prices, schedules

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

What kind of inheritance does the JavaScript programming language use?

A

JavaScript includes a specific kind of inheritance known as prototype-based (or prototypal) inheritance.

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

What is a prototype in JavaScript?

A

prototype is simply an object that contains properties and (predominantly) methods that can be used by other objects.

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

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?

A

if those are inherited as a prototytpe

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

If an object does not have it’s own property or method by a given key, where does JavaScript look for it?

A

it’s parent

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

What is a client?

A

A client is the receiving end of a service or the requestor of a service

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

What is a server?

A

provides functionality for other programs or devices

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

Which HTTP method does a browser issue to a web server when you visit a URL?

A

The browser sends a HTTP request to the server. get method

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

What three things are on the start-line of an HTTP request message?

A

An HTTP method, a verb (like GET , PUT or POST ) or a noun (like HEAD or OPTIONS )
target
httpversion

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

What three things are on the start-line of an HTTP response message?

A

Status line, header and body.

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

What are HTTP headers?

A

Response headers hold additional information about the response, like its location or about the server providing it

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

Is a body required for a valid HTTP request or response message?
Exercise

A

no

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

What does the new operator do?

A

Creates a blank, plain JavaScript object.
Adds a property to the new object (__proto__) that links to the constructor function’s prototype object
Note: Properties/objects added to the construction function prototype are therefore accessible to all instances created from the constructor function (using new).

Binds the newly created object instance as the this context (i.e. all references to this in the constructor function now refer to the object created in the first step).
Returns this if the function doesn’t return an object.

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

What property of JavaScript functions can store shared behavior for instances created with new?

A

You can add a shared property to a previously defined object type by using the Function.prototype property.

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

What does the instanceof operator do?

A

The instanceof operator tests to see if the prototype property of a constructor appears anywhere in the prototype chain of an object.

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

What is a “callback” function?

A

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.

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

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?

A

settimeout

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

How can you set up a function to be called repeatedly without using a loop?

A

setinterval

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

What is the default time delay if you omit the delay parameter from setTimeout() or setInterval()?

A

0

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

What do setTimeout() and setInterval() return?

A

intervalID

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

What is AJAX?

A

Asynchronous JavaScript And XML
A browser built-in XMLHttpRequest object (to request data from a web server)
JavaScript and HTML DOM (to display or use the data)
tool for making network requests for the website without having to load a new webpage

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

What does the AJAX acronym stand for?

A

Asynchronous JavaScript And XML

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

Which object is built into the browser for making HTTP requests in JavaScript?

A

XMLHttpRequest

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

What event is fired by XMLHttpRequest objects when they are finished loading the data from the server?

A

load event

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

Bonus Question: An XMLHttpRequest object has an addEventListener() method just like DOM elements. How is it possible that they both share this functionality?

A

xhr prototypes from xhr event target and that prototypes from eventtarget

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

What is a code block? What are some examples of a code block?

A

code enclosed by {}

used in if, for, while, functions

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

What does block scope mean?

A

Means while in the block, which is the {}, the variables are only accessible within that block,

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

What is the scope of a variable declared with const or let?

A

block scope

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

What is the difference between let and const?

A

const is immutable

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

Why is it possible to .push() a new value into a const variable that points to an Array?

A

The const keyword ensures that the variable it creates is read-only. However, it doesn’t mean that the actual value to which the const variable reference is immutable.

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

How should you decide on which type of declaration to use?

A

If you are planning to change the value of the variable or not

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

What is the syntax for writing a template literal?

A

using backticks

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

What is “string interpolation”?

A

substituting parts of the string for values or variables

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

What is destructuring, conceptually?

A

taking properties and assigning them to variables

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

What is the syntax for Object destructuring?

A

let {propertyName : variableName} = object

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

What is the syntax for Array destructuring?

A

let [variable1, variable2] = Array

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

How can you tell the difference between destructuring and creating Object/Array literals?

A

use of let/const in defining variables. structuring

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

What is the syntax for defining an arrow function?

A

let add = (x, y) => x + y;

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

When an arrow function’s body is left without curly braces, what changes in its functionality?

A

implicit return vs explicit return

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

How is the value of this determined within an arrow function?

A

Unlike an anonymous function, an arrow function captures the this value of the enclosing context instead of creating its own this context.

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

What is a CLI?

A

command line interface

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

What is a GUI?

A

graphical user interface

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
69
Q
ive at least one use case for each of the commands listed in this exercise.
man
cat
ls
pwd
echo
touch
mkdir
mv
rm
cp
A
man- manual look up man man
cat-show contents of file cat -a
ls- list out files
pwd- print current directory
echo-log to directory or put text into file
touch-create new file 
mkdir- make new directory
mv- rename file
rm- remove file
cp-copy contents of file to another file
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
70
Q

What are the three virtues of a great programmer?

A

adaptability, recognition, diligence

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

What is Node.js?

A

Node.js is a program that allows JavaScript to be run outside of a web browser.

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

What can Node.js be used for?

A

It is commonly used to build back ends for Web applications, command-line programs, or any kind of automation that developers wish to perform.

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

What is a REPL?

A

A read–eval–print loop (REPL), also termed an interactive toplevel or language shell, is a simple interactive computer programming environment that takes single user inputs, executes them, and returns the result to the user

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

When was Node.js created?

A

2009

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

What back end languages have you heard of?

A

C#, python, Ruby

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

What is a computer process?

A

process is the instance of a computer program that is being executed by one or many threads. It contains the program code and its activity.

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

Roughly how many computer processes are running on your host operating system (Task Manager or Activity Monitor)?

A

40

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

Why should a full stack Web developer know that computer processes exist?

A

Full stack Web development is based on making multiple processes work together to form one application, so having at least a cursory awareness of computer processes is necessary

79
Q

What is the process object in a Node.js program?

A

The process object is a global that provides information about, and control over, the current Node.js process.

80
Q

How do you access the process object in a Node.js program?

A

can just call it as process since it is global

81
Q

What is the data type of process.argv in Node.js?

A

Array

82
Q

What is a JavaScript module?

A

In JavaScript, a “module” is a single .js file.

Most non-trivial Node.js programs are made of many, many modules.

83
Q

What values are passed into a Node.js module’s local scope?

A

exports, require, __filename, __dirname, module

84
Q

Give two examples of truly global variables in a Node.js program.

A

console, process

85
Q

What is the purpose of module.exports in a Node.js module?

A

use content in a different js file

86
Q

How do you import functionality into a Node.js module from another Node.js module?

A

require

87
Q

What is the JavaScript Event Loop?

A

Pushes the queue events into the stack

88
Q

What is different between “blocking” and “non-blocking” with respect to how code is executed?

A

blocking calls onto the stack so other processes can’t complete until the stack clears
non-blocking pushes the task into a callback on the task queue that allows other processes to also be called in between callback tasks

89
Q

What is a directory?

A

A directory is an area on the computer containing other directories and files and helps keep the computer organized.

90
Q

What is a relative file path?

A

the hierarchical path that locates a file or folder on a file system starting from the current directory.

91
Q

What is an absolute file path?

A

always contains the root element and the complete directory list required to locate the file.

92
Q

What module does Node.js include for manipulating the file system?

A

fs

93
Q

What method is available in the Node.js fs module for writing data to a file?

A

fs.writeFile

94
Q

Are file operations using the fs module synchronous or asynchronous?

A

Asynchronous

95
Q

What is a client?

A

system sending requests to server

96
Q

What is a server?

A

system that holds data and receives request from client

97
Q

Which HTTP method does a browser issue to a web server when you visit a URL?

A

get

98
Q

What is on the first line of an HTTP request message?

A

method ,target, version

99
Q

What is on the first line of an HTTP response message?

A

protocol version, status code, status text

100
Q

What are HTTP headers?

A

HTTP headers let the client and the server pass additional information with an HTTP request or response.

101
Q

Is a body required for a valid HTTP message?

A

no

102
Q

What is NPM?

A

npm is the world’s largest software registry.

103
Q

What is a package?

A

directory with files including a package.json

104
Q

How can you create a package.json with npm?

A

npm init -y

105
Q

What is a dependency and how to you add one to a package?

A

dependencies are the package references that are used by your library without which it cannot work and to be installed along with your library installation automatically.

106
Q

What happens when you add a dependency to a package with npm?

A

add to the node modules folder and list it in the dependencies in the

107
Q

How do you mount a middleware with an Express application?

A

Bind application-level middleware to an instance of the app object by using the app.use() and app.METHOD() functions,

108
Q

Which objects does an Express application pass to your middleware to manage the request/response lifecycle of the server?

A

req, res, next

109
Q

What is the appropriate Content-Type header for HTTP messages that contain JSON in their bodies?

A

app/json

110
Q

What is the significance of an HTTP request’s method?

A

it is what the app will read to determine what action to take

111
Q

What does the express.json() middleware do and when would you need it?

A

parses for json data and stores it in req.body

need it when receiving json data

112
Q

What is PostgreSQL and what are some alternative relational databases?

A

PostgreSQL is a powerful, free, open source Relational Database Management System (RDBMS).
Other popular relational databases include MySQL (also free), SQL Server by Microsoft, and Oracle by Oracle Corporation.

113
Q

What are some advantages of learning a relational database?

A

A quality of many relational databases is that they support good guarantees about data integrity. They can store and modify data in a way that makes data corruption as unlikely as possible.
Many problem domains can be modeled well using a relational database.

114
Q

What is one way to see if PostgreSQL is running?

A

top

sudo service postgresql status

115
Q

What is a database schema?

A

a collection of tables

116
Q

What is a table?

A

A table is a list of rows each having the same set of attributes.

117
Q

What is a row?

A

row is a record in that spreadsheet. an instance of a data

118
Q

What is SQL and how is it different from languages like JavaScript?

A

Structured Query Language (SQL) is the primary way of interacting with relational databases. It is a powerful way of retrieving, creating, and manipulating data in a relational database.
SQL is a declarative programming language while JS is imperative

119
Q

How do you retrieve specific columns from a database table?

A

select “column-name”

120
Q

How do you filter rows based on some specific criteria?

A

where “category” = ‘category-name’

121
Q

What are the benefits of formatting your SQL?

A

easier to read and not make mistakes, catch errors more easily

122
Q

What are four comparison operators that can be used in a where clause?

A

= , >,

123
Q

How do you limit the number of rows returned in a result set?

A

limit number;

124
Q

How do you retrieve all columns from a database table?

A

*

125
Q

How do you control the sort order of a result set?

A

order by

126
Q

How do you add a row to a SQL table?

A

insert

127
Q

What is a tuple?

A

a list of values

128
Q

How do you add multiple rows to a SQL table at once?

A

values (), (), ()

129
Q

How do you get back the row being inserted into a table without a separate select statement?

A

returning *

130
Q

How do you update rows in a database table?

A

update

131
Q

Why is it important to include a where clause in your update statements?

A

updates the entire table by default

132
Q

How do you delete rows from a database table?

A

delete from “”

133
Q

How do you accidentally delete all rows from a table?

A

not specifying using where

134
Q

What is a foreign key?

A

a key id that points to another table

135
Q

How do you join two SQL tables?

A
using 
join using ("key")
136
Q

How do you temporarily rename columns or tables in a SQL statement?

A

as

137
Q

What are some examples of aggregate functions?

A

count, avg, sum,min, every,

138
Q

What is the purpose of a group by clause?

A

to apply aggregate functions to specific categories

139
Q

What are the three states a Promise can be in?

A

pending: initial state, neither fulfilled nor rejected.
fulfilled: meaning that the operation was completed successfully.
rejected: meaning that the operation failed.

140
Q

How do you handle the fulfillment of a Promise?

A

with a promise.then value=>{}

141
Q

How do you handle the rejection of a Promise?

A

catch (err)=>

142
Q

What is Array.prototype.filter useful for?

A

The filter() method creates a new array with all elements that pass the test implemented by the provided function.

143
Q

What is Array.prototype.map useful for?

A

The map() method creates a new array populated with the results of calling a provided function on every element in the calling array.

144
Q

What is Array.prototype.reduce useful for?

A

reduces array to single value

145
Q

What is “syntactic sugar”?

A

In computer science, syntactic sugar is syntax within a programming language that is designed to make things easier to read or to express

146
Q

What is the typeof an ES6 class?

A

function

147
Q

Describe ES6 class syntax.

A
class Person {
    constructor(name) {
        this.name = name;
    }
    getName() {
        return this.name;
    }
}
148
Q

What is “refactoring”?

A

In computer programming and software design, code refactoring is the process of restructuring existing computer code—changing the factoring—without changing its external behavior.

149
Q

What is Webpack?

A

modular bundler- compiles js modules

150
Q

How do you add a devDependency to a package?

A

npm install –save-dev

151
Q

What is an NPM script?

A

short cut scripts to run commands

152
Q

How do you execute Webpack with npm run?

A

in package.json you add key value pair to run webpack

153
Q

How are ES Modules different from CommonJS modules?

A

import/export usage instead of require/module.export

154
Q

What kind of modules can Webpack support?

A
ECMAScript modules
CommonJS modules
AMD modules
Assets
WebAssembly modules
ES6
In addition to that webpack supports modules written in a variety of languages and preprocessors via loaders.
155
Q

What is React?

A

JS library for creating user interfaces

Built with JS

156
Q

What is a React element?

A

Object that represents a DOM element

157
Q

How do you mount a React element to the DOM?

A

ReactDom.render(mounting, base)

158
Q

What is Babel?

A

Babel is a JavaScript compiler
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.

159
Q

What is a Plug-in?

A

In computing, a plug-in (or plugin, add-in, addin, add-on, or addon) is a software component that adds a specific feature to an existing computer program.

160
Q

What is a Webpack loader?

A

Loaders are transformations that are applied to the source code of a module. They allow you to pre-process files as you import or “load” them.
Loaders can transform files from a different language (like TypeScript) to JavaScript or load inline images as data URLs

161
Q

How can you make Babel and Webpack work together?

A

use bable as a plugin for the export in the config

162
Q

What is JSX?

A

syntax extension to JavaScript.

allows combination of design and logic

163
Q

Why must the React object be imported when authoring JSX in a module?

A

Since JSX compiles into calls to React.createElement, the React library must also always be in scope from your JSX code.

164
Q

How can you make Webpack and Babel work together to convert JSX into valid JavaScript?

A

Babel uses a plugin to convert JSX into javascript

@babel/plugin-transform-react-jsx

165
Q

What is a React component?

A

Conceptually, components are like JavaScript functions. They accept arbitrary inputs (called “props”) and return React elements describing what should appear on the screen.
components are usable and describes piece of the ui

166
Q

How do you define a function component in React?

A

The simplest way to define a component is to write a JavaScript function:

function Welcome(props) {
  return <h1>Hello, {props.name}</h1>;
}
167
Q

How do you mount a component to the DOM?

A

root.render

168
Q

What are props in React?

A

arguments passed into react components

169
Q

How do you pass props to a component

A

set prop.property = “”

170
Q

How do you write JavaScript expressions in JSX?

A

within {}

171
Q

How do you create “class” component in React?

A
class Welcome extends React.Component {
  render() {
    return <h1>Hello, {this.props.name}</h1>;
  }
}
172
Q

How do you access props in a class component?

A

this.props.wantedproperty

173
Q

What is the purpose of state in React?

A

state is private and fully controlled by the component. updating state with setstate updates the component’s render also

174
Q

How to you pass an event handler to a React element?

A

provide a listener when the element is rendered

175
Q

What are controlled components?

A

In HTML, form elements such as , , and typically maintain their own state and update it based on user input. In React, mutable state is typically kept in the state property of components, and only updated with setState().

We can combine the two by making the React state be the “single source of truth”. Then the React component that renders a form also controls what happens in that form on subsequent user input. An input form element whose value is controlled by React in this way is called a “controlled component”.

176
Q

What two props must you pass to an input for it to be “controlled”?

A

handleChange and handleSubmit

177
Q

What Array method is commonly used to create a list of React elements?

A

map

178
Q

What is the best value to use as a “key” prop when rendering lists?

A

id

179
Q

What does express.static() return?

A

a function

180
Q

What is the local __dirname variable in a Node.js module?

A

the directory path of where the node file is being run

181
Q

What does the join() method of Node’s path module do?

A

join() method joins the specified path segments into one path.

182
Q

What does fetch() return?

A

response object as json

183
Q

What is the default request method used by fetch()?

A

get

184
Q

How do you specify the request method (GET, POST, etc.) when calling fetch?

A
const response = await fetch(url, {
    method: 'POST', // *GET, POST, PUT, DELETE, etc.
    mode: 'cors', // no-cors, *cors, same-origin
    cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached
    credentials: 'same-origin', // include, *same-origin, omit
    headers: {
      'Content-Type': 'application/json'
      // 'Content-Type': 'application/x-www-form-urlencoded',
    },
    redirect: 'follow', // manual, *follow, error
    referrerPolicy: 'no-referrer', // no-referrer, *no-referrer-when-downgrade, origin, origin-when-cross-origin, same-origin, strict-origin, strict-origin-when-cross-origin, unsafe-url
    body: JSON.stringify(data) // body data type must match "Content-Type" header
  });
----The fetch() method can optionally accept a second parameter, an init object that allows you to control a number of different settings:
185
Q

When does React call a component’s componentDidMount method?

A

After rendering the component to the dom

186
Q

Name three React.Component lifecycle methods.

A

componentDidMount
componentWillUnmount
componentDidUpdate

187
Q

How do you pass data to a child component?

A

into their props

188
Q

What does the acronym LIFO mean?

A

Last in first out

189
Q

What methods are available on a Stack data structure?

A

pop, push, peek, print

190
Q

What must you do to access the value at an arbitrary point in a stack (not just the “top”)?

A

take out the items above that point

191
Q

What does the acronym FIFO mean?

A

first in first out

192
Q

What methods are available on a Queue data structure?

A

enqueue, dequeue, peek, print

193
Q

What must you do to access the value at an arbitrary point in a queue (not just the “front”)?

A

index through the queue, dequeue and enqueue