Study Cards Flashcards

(321 cards)

1
Q

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

A

In the head element.

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 body element.

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

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

A

In the html element.

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

What is the purpose of a !DOCTYPE declaration?

A

To instruct the web browser what document type to expect.

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

What is the purpose of HTML attributes?

A

To provide additional information about the contents of an element.

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

How do block-level elements affect the document flow?

A

Always appear on a new line, and take up the entire horizontal space of their parent element.

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

How do inline elements affect the document flow?

A

Continue on the same line as neighboring elements.

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

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

A

Width: Entire horizontal space of its parent element.
Height: Height of its contents.

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

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

A

The width and height of its contents.

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

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

A

Ordered list items are numbered, unordered list items are not.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
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
12
Q

What HTML tag is used to link to another website?

A

a tag

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

What is an absolute URL?

A

The full web address.

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

What is a relative URL?

A

A shorthand link address for a page within the same site.

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

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

A

../

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

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

A

The name of the directory.

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 grand parent directory?

A

../../

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

How do you indicate the link to the same directory?

A

Simply use the name of the target file.

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

What is the purpose of an HTML form element?

A

To allow users to submit data.

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

Give five examples of form control elements.

A

buttons, checkboxes, radio buttons, text input, select lists

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

Give three examples of type attributes for HTML < input > elements.

A

text, email, password, radio, checkbox, submit

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

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

A

inline

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

What are the six primary HTML elements for creating tables?

A

< table >, < thead >, < tbody >, < tr >, < th >, < td >

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

What purpose do the thead and tbody elements serve?

A

Differentiate between the headers and the general table data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Give two examples of data that would lend itself well to being displayed in a table.
Stocks, sports statistics, etc.
26
What are the names of the individual pieces of a CSS rule?
Selector, curly braces which define the declaration block, and property/value pairs.
27
In CSS, how do you select elements by their class attribute?
With a .classname
28
In CSS, how do you select elements by their type?
The name of the element
29
In CSS, how do you select an element by its id attribute?
With a #idname
30
Name three different types of values you can use to specify colors in CSS.
Color names, RGB values, HEX codes
31
What CSS properties make up the box model?
Content, padding, border, and margin.
32
Which CSS property pushes boxes away from each other?
Margin
33
Which CSS property adds space between a box's content and its border?
Padding
34
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
35
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.
36
What CSS property controls the font used for the text inside an element?
font-family
37
What is the default flex-direction of a flex container?
row
38
What is the default flex-wrap of a flex container?
no-wrap
39
Why do two div elements "vertically stack" on one another by default?
They are block level elements by default
40
What is the default flex-direction of an element with display: flex?
row
41
What is the default value for the position property of HTML elements?
static
42
How does setting position: relative on an element affect document flow?
It doesn't
43
How does setting position: relative on an element affect where it appears on the page?
It doesn't
44
How does setting position: absolute on an element affect document flow?
It removes the element from the document flow.
45
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)
46
What is the main purpose of using position: absolute?
Layering elements on top of other elements.
47
How do you constrain an absolutely positioned element to a containing block?
Give a parent element a position: relative
48
What are the four box offset properties?
top, bottom, left, right
49
What is the purpose of variables?
To store data for later use.
50
How do you declare a variable?
const or let variableName = value;
51
How do you initialize (assign a value to) a variable?
with const or let keyword variableName = value
52
What characters are allowed in variable names?
Letter, number, underscore. The first character CANNOT be a number.
53
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.
54
What is the purpose of a string?
To hold data that can be represented in text form.
55
What is the purpose of a number?
To save a number to be used in mathematical calculation.
56
What is the purpose of a boolean?
Useful when the data can only have two possible values, true or false.
57
What does the = operator mean in JavaScript?
assignment
58
How do you update the value of a variable?
variableName = newValue; (var keyword only to be used during initial variable creation)
59
What is the difference between null and undefined?
null is an empty value, undefined means no value has been assigned
60
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.
61
Give five examples of JavaScript primitives
string, number, boolean, null, undefined
62
What data type is returned by an arithmetic operation?
number
63
What is string concatenation?
appending one string to the end of another string
64
What purpose(s) does the + plus operator serve in JavaScript?
addition operator and concatenation operator
65
What data type is returned by comparing two values (greater than/less than operator, ===, etc)?
Boolean
66
What does the += "plus-equals" operator do?
Adds the provided value to a variable
67
What are objects used for?
Holding data in the form of multiple properties split into key-value pairs.
68
What are object properties?
Data held within objects in the form of key-value pairs
69
Describe object literal notation.
A set of curly braces with key-value pairs contained within
70
How do you remove a property from an object?
with the delete operator (delete objectName.propertyName)
71
What are two ways to get or update the value of a property?
Dot notation (objectName.propertyName) (preferred) and bracket notation (objectName["propertyName"])
72
What are arrays used for?
Holding lists of related data in an ordered format.
73
Describe array literal notation.
A set of brackets with values separated by commas.
74
How are arrays different from "plain" objects?
They are ordered, and contain values at numbered indexes rather than key-value pairs
75
What number represents the first index of an array?
0
76
What is the length property of an array?
Determines the number of values contained in the array
77
How do you calculate the last index of an array?
array.length - 1
78
What is a function in JavaScript?
A set of "instructions", whose code can be saved and called for later use
79
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.
80
Describe the parts of a function call.
The name of the function and parentheses, as well as any arguments in the parentheses if necessary
81
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
82
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.
83
Why are function parameters useful?
Allows us to pass different data to functions, to use the same function to perform different tasks.
84
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.
85
Why do we log things to the console?
To check our work during the development phase
86
What is a method?
A function which is a property of an object
87
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
88
How do you remove the last element from an array?
the .pop() method
89
How do you round a number down to the nearest integer?
the Math.floor() method
90
How do you generate a random number?
the Math.random() method
91
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
92
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
93
How do you break a string up into an array?
the .split() method
94
Is the return value of a function or method useful in every situation?
No, sometimes the return value is not needed
95
What three-letter acronym should you always include in your Google search about a JavaScript method or CSS property?
MDN
96
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
97
What data type do comparison expressions evaluate to?
Boolean
98
What is the purpose of an if statement?
To determine whether or not to run code based on a condition
99
Is else required in order to use an if statement?
No
100
Describe the syntax of an if statement
if (condition) { | }
101
What are three logical operators?
and (&&), or (||), and not (!)
102
What is the purpose of a loop?
To require code to be repeated
103
What is the purpose of a condition expression in a loop?
Determine whether or not the code should be run again
104
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
105
When does the condition expression of a while loop get evaluated?
Every iteration before the code block is run
106
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
107
When does the condition expression for a for loop get evaluated?
After the initialization, and on every iteration before the code block is run
108
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
109
Besides a return statement, which exits its entire function block, which keyword exits a loop before its condition expression evaluates to false?
break
110
What does the ++ increment operator do?
Increases the value of the variable by 1
111
How do you iterate through the keys of an object?
for...in loop
112
What are the 4 components of the CSS cascade?
source order, inheritance, specificity, and !important
113
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
114
How is it possible for the styles of an element to be applied to its children as well without an additional CSS rule?
Inheritance
115
List the three selector types in order of increasing specificity
element, class, id
116
Why is using !important considered bad practice?
It overrides other declarations and breaks the natural cascading of stylesheets
117
Why do we log things to the console?
To show data of what our code is doing for use in the development phase.
118
Which "document" is being referred to in the phrase Document Object Model?
The actual html page that is being modeled in JavaScript
119
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
120
What is a DOM Tree?
The model of the web page with parent/child relationships, created by the DOM.
121
Give two examples of document methods that retrieve a SINGLE element from the DOM
.querySelector(), .getElementById()
122
Give one example of a document method that retrieves multiple elements from the DOM at once
.querySelectorAll()
123
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.
124
What console method allows you to inspect the properties of a DOM element object?
console.dir()
125
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
126
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
127
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
128
What is the purpose of events and event handling?
To allow JavaScript to make changes when a user interacts with the page
129
What do [ ] square brackets mean in function and method syntax documentation?
Optional
130
What method of element objects lets you set up a function to be called when a specific type of event occurs?
.addEventListener()
131
What is a callback function?
A previously defined function that is used later in the code
132
What object is passed into an event listener callback when the event fires?
The event
133
What is the event.target?
The object on which the event is occuring
134
What is the className property of element objects?
allows us to access or change the class of an element
135
How do you update the CSS class attribute of an element using JavaScript?
.className property
136
What is the textContent property of element objects?
allows us to access or change the text content of an element
137
How do you update the text within an element using JavaScript?
.textContent property
138
Is the event parameter of an event listener callback always useful?
No, sometimes it is not needed in the callback function
139
What does the CSS transform property do?
Changes how an element is displayed visually (including translate(), scale(), rotate(), skew(), and matrix() )
140
The transition property is shorthand for which four CSS properties?
transition-property, transition-duration, transition-timing-function, and transition-delay
141
What event is fired when a user places their cursor in a form control?
focus
142
What event is fired when a user's cursor leaves a form control?
blur
143
What is fired as a user changes the value of a form control?
input
144
What event is fired when a user clicks the "submit" button within a form?
submit
145
What does the event.preventDefault() method do?
Prevents the browser from refreshing
146
What property of a form element object contains all of the form's controls?
elements
147
What property of a form control object gets and sets its value?
value
148
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.
149
What is an advantage of having your console open when writing a JavaScript program?
You can check your code as you go
150
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()
151
How do you add an element as a child to another element?
appendChild() method
152
What do you pass as the arguments to the element.setAttribute() method?
('attributename', 'value')
153
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()
154
What is the textContent property of an element object for?
getting and setting the text content of an element
155
Name two way to set the class attribute of a DOM element
setAttribute() method and className property
156
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
157
Give two examples of media features that you can query in a @media rule
width, height, resolution, orientation, aspect-ratio, many more...
158
Which HTML meta tag is used in mobile-responsive web pages?
159
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
160
What DOM element property tells you what type of element it is?
event.target.tagName
161
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
162
How can you remove an element from the DOM?
remove()
163
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
164
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
165
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
166
How can you retrieve the value of an element's attribute?
getAttribute()
167
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
168
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
169
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
170
What is JSON?
a text-based data format following JavaScript object syntax
171
What are serialization and deserialization?
Converting data (objects, etc) into bytes (a string in the case of JSON) to be transmitted
172
How do you serialize a data structure into a JSON string using JavaScript?
.stringify() method
173
How do you deserialize a JSON string into a data structure using JavaScript?
.parse() method
174
What method do you use to store data in localStorage?
.setItem()
175
What method do you use to retrieve data in localStorage?
.getItem()
176
What data type can localStorage save in the browser?
string
177
When does the 'beforeunload' event fire on the window object?
When the page is refreshed, closed, or unloaded in some way
178
What is a method?
A function that is a property of an object
179
How can you tell the difference between a method definition and a method call?
A method call will include .methodname()
180
What is the defining characteristic of Object-Oriented Programming (OOP)?
objects can contain both data (as properties) and behavior (as methods)
181
What is abstraction?
being able to work with (possibly) complex things in simple ways
182
What does API stand for?
application programming interface
183
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
184
What is 'this' in JavaScript?
An implicit parameter of an object
185
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
186
When is the value of this determined in a function; call time or definition time?
call time
187
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
188
What kind of inheritance does the JavaScript programming language use?
Prototype-based inheritance
189
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
190
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
191
What does the new operator do?
Create a new instance of the object type specified by the constructor function
192
What property of JavaScript functions can store shared behavior for instances created with new?
prototype
193
What does the instanceof operator do?
Determines whether the specified object is an instance of the specified constructor. Returns a boolean value.
194
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()
195
How can you set up a function to be called repeatedly without using a loop?
setInterval()
196
What is the default time delay if you omit the delay parameter from setTimeout() or setInterval()?
0 (execute immediately)
197
What do setTimeout() and setInterval() return?
The timer ID (a positive integer). Can be passed to clearTimeout() to cancel the timer
198
What is a code block? What are some examples?
The code contained within a set of curly braces in a function, if statement, loop
199
What does block scope mean?
A block scope variable can only be accessed in the code block where it is declared
200
What is the scope of a variable declared with const or let?
Block scope
201
What is the difference between let and const?
let can be reassigned, const cannot
202
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
203
How should you decide which type of variable declaration to use?
const unless a variable will need to be reassigned, then use let
204
What is destructuring, conceptually?
Makes it possible to unpack values from arrays, or properties from objects, into distinct variables
205
What is the syntax for object destructuring?
const { property1, property2 } = objectName
206
What is the syntax for array destructuring?
const [ element1, element2 ] = arrayName
207
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
208
What is the syntax for writing a template literal?
Surround in backticks (``), javascript expressions contained in ${}
209
What is string interpolation?
Replacing placeholders with values in a string literal
210
What is the syntax for defining an arrow function?
(parameter1, parameter2) => { code block }
211
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
212
How is the value of 'this' determined within an arrow function?
It derives the value of 'this' from the scope where it was created
213
What is Node.js?
An asynchronous event-driven JS runtime, which allows JS to be run outside of a web browser
214
What can Node.js be used for?
To build back ends for web apps, command-line programs, or develop other automation
215
What is a REPL?
Read-eval-print loop
216
What is a CLI?
Command line interface
217
What is a GUI?
Graphical user interface
218
What is a computer process?
An instance of a computer program that is being executed
219
What is the process object in a Node.js program?
A global object the provides info and control over the current Node.js process
220
How do you access the process object in a Node.js program?
It is a global object, so using "process"
221
What is the data type of process.argv in Node.js
Array
222
What is a JavaScript module?
A single JavaScript file
223
What values are passed into a Node.js module's global scope?
exports, module, require(), __dirname, __filename
224
What is the purpose of module.exports in a Node.js module?
To access a module's code from a different module
225
How do you import functionality into a Node.js module from another Node.js module?
require()
226
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
227
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
228
What module does Node.js include for manipulating the file system?
fs
229
What method is available in the Node.js fs module for writing data to a file?
writeFile()
230
Are file operations using the fs module synchronous or asynchronous?
There are asynchronous and synchronous operations
231
Which HTTP method does a browser issue to a web server when you visit a URL?
GET
232
What is on the first line of an HTTP request message?
The request method (get, post, etc), target, and HTTP standard (HTTP/1.1)
233
What is on the first line of an HTTP response message?
The HTTP standard (HTTP/1.1), status code, and status message
234
What are HTTP headers?
Additional information passed with an HTTP request or response
235
Is a body required for a valid HTTP message?
No
236
What is npm?
A service comprised of a website, command line interface, and registry of code packages that can be utilized
237
What is a package?
A directory containing code files, as well as a package.json file.
238
How can you create a package.json with npm?
npm init --yes
239
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
240
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
241
How do you add express to your package dependencies?
npm install express
242
What Express application method starts the server and binds it to a network PORT?
.listen()
243
How do you mount a middleware with an Express application?
.use()
244
Which objects does an Express application pass to your middleware to manage the request/response lifecycle of the server?
request and response objects
245
What is the appropriate Content-Type header for HTTP messages that contain JSON in their bodies?
application/json
246
What is the significance of an HTTP request's method?
It is purely semantic, all requests have the same functionality
247
What does the express.json() middleware do?
Automatically parses incoming requests with JSON
248
What is PostgreSQL and what are some alternatives?
A relational database. Other relational databases: MySQL, Oracle, Microsoft SQL Server...
249
What are some advantages of learning a relational database?
Ideal for storing related data. Make data corruption as unlikely as possible.
250
What is one way to see if PostgreSQL is running?
sudo service postgresql status
251
What is a database schema?
A collection of tables. Defines how the data in a relational database should be organized
252
What is a table in a relational database?
A list of rows, each having the same set of attributes
253
What is a row in a relational database?
An instance of a record
254
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.
255
How do you retrieve specific columns from a database table?
select keyword with columns in double quotes
256
How do you filter rows based on some specific criteria?
where keyword with comparison operators
257
What are the benefits of formatting your SQL?
Consistency and readability
258
What are four SQL comparison operators that can be used in a where clause?
=, , >+, <=, <> (not equal)
259
How do you limit the number of rows returned in a database result set?
Limit keyword with number
260
How do you retrieve all columns from a database table?
*
261
How do you control the sort order of a result set?
order by ""
262
How do you add a row to a SQL table?
insert into "tablename" ("columns" separated by commas) | values ('correspondingvalues' separated by commas)
263
What is a tuple?
A list of values in SQL
264
How do you add multiple rows to a SQL table at once?
Specify more than one tuple of values, separated by commas
265
How do you get back the row being inserted into a table without a separate select statement?
returning *
266
How do you update rows in a database table?
update "tablename" | set "columnname" = 'value'
267
Why is it important to include a where clause in your update statements?
So you don't update EVERY row in the table
268
How do you delete rows from a database table?
delete from "tablename" | where "columnname" = 'value'
269
How do you accidentally delete all rows from a table?
delete from "tablename" | without specifying a where statement
270
What is a foreign key?
A table column that refers to values in another table
271
How do you join two SQL tables?
After from statement, use: | join "tablename" using ("connectioncolumnname")
272
How do you temporarily rename columns or tables in a SQL statement?
select "columnname" as "aliasname"
273
What are some examples of aggregate functions in SQL?
sum(), count(), avg(), max(), min(), every()
274
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
275
What are the three states a Promise can be in?
pending, fulfilled, rejected
276
How do you handle the fulfillment of a Promise?
.then() method, with fulfillment handler function passed in
277
How do you handle the rejection of a Promise?
.catch() method, with rejection handler function passed in
278
What is Array.prototype.filter useful for?
Creating a new array with all elements that pass the test in the provided function
279
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
280
What is Array.prototype.reduce useful for?
Executes a function on each element of an array, returning a single output value
281
What is "syntactic sugar"?
Functions the same, but looks better/cleaner
282
What is the typeof an ES6 class?
Function
283
Describe ES6 class syntax
class functionName {}
284
What is "refactoring"?
Restructuring existing code without changing its external behavior, with the intention of improving it
285
What is Webpack?
A tool to bundle JavaScript applications/modules
286
How do you add a devDependency to a package?
npm install packagename --save-dev
287
What is an npm script?
npm scripts can automate repetitive tasks. Located in package.json
288
How do you execute Webpack with npm run?
Add "build": "webpack" script in package.json, and use command npm run build
289
What is React?
A component-based JavaScript library for building interactive user interfaces
290
What is a React element?
An object created with React.createElement that describes what you will see on the screen.
291
How do you mount a React element to the DOM?
ReactDOM.render(element, container[, callback])
292
What is Babel?
A JavaScript compiler used to covert ES6 code into a backwards compatible version of JavaScript
293
What is a Plug-in?
A software component that adds an additional feature to an existing program
294
What is a webpack loader?
Transforms source code of a module before they are loaded
295
How can you make babel and webpack work together?
With babel-loader
296
What is JSX?
A syntax extension to JavaScript, used with React
297
Why must the React object be imported when authoring JSX in a module?
When we are using JSX, it is implicitly using React methods.
298
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
299
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
300
How do you define a function component in React?
``` function Name(props) { return } ```
301
How do you mount a React component to the DOM?
With ReactDOM.render() method
302
What are props in React?
Properties used for passing data to components
303
How do you pass props to a component?
By passing the prop as a key value pair when creating a react element
304
How do you write JavaScript expressions in JSX?
Inside curly braces
305
How do you create class components in React?
class Name extends React.component {}
306
How do you access props in a React class component?
this.props
307
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
308
How to you pass an event handler to a React element?
As a prop, prop name is the name of the event in camelCase
309
What are controlled components in React?
A form element whose value is controlled by React
310
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
311
What Array method is commonly used to create a list of React elements?
map()
312
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
313
What does express.static() return?
A middleware function
314
What is the local __dirname variable in a Node.js module?
The directory name of the current module, as a string
315
What does the join() method of Node's path module do?
Joins all given path segments together and normalizes the resulting path
316
What does fetch() return?
A promise that resolves to a response object
317
What is the default request method used by fetch()?
GET
318
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'
319
When does React call a component's componentDidMount method?
Immediately after a component is initially mounted
320
Name three React.Component lifecycle methods.
componentDidMount, componentDidUpdate, componentWillUnmount
321
How do you pass data to a child component in React?
As props