HTML Flashcards

1
Q

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

A

inside 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

inside 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 tags go in a valid HTML document?

A

inside 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 let the browser know what html version the page is using

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

Give five examples of HTML element tags.

A

p, div, head, title, h1

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

to give more information about 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

& amp for ampersand

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 always show up on a new line

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 do not take up a new line and start next to previous content

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

default width is all the width of the container and default height is however much height it needs

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

default width and height are both however much space the element needs, however cannot be modified through CSS

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

Unordered lists begin with bullet points, ordered lists are numbered

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

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

A

Lists are block level elements

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

What HTML tag is used to link to another website?

A

the anchor tag

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

What is an absolute URL?

A

Absolute paths are the full paths to a specific resource

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

What is a relative URL?

A

Relative paths are paths that are relative to your current path

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

../

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

childDirectory/

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

../../

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

./

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

to collect information from a user

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

radio button, checkboxes, drop-down boxes, submit button, text input

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

Give three examples of type attributes for HTML input elements.

A

radio, checkbox, submit

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
What are the six primary HTML elements for creating tables?
table, thead, tbody, tr, td, th
26
What purpose do the thead and tbody elements serve?
thead is used as the heading for the table | tbody is used for the body content of the table
27
Give two examples of data that would lend itself well to being displayed in a table.
weather forecast, report card
28
What are the names of the individual pieces of a CSS rule?
selector and declaration
29
In CSS, how do you select elements by their class attribute?
.className
30
In CSS, how do you select elements by their type?
their tag
31
In CSS, how do you select an element by its id attribute?
#idvalue
32
Name three different types of values you can use to specify colors in CSS.
hex value, name, rgb values, and hsl
33
What CSS properties make up the box model?
border, margin, padding
34
Which CSS property pushes boxes away from each other?
margin
35
Which CSS property add space between a box's content and its border?
padding
36
What is a pseudo-class?
specifies a special state of an element
37
What are CSS pseudo-classes useful for?
let's you dynamically change the style of an element based on a user's interaction with it or other external factors
38
Name at least two units of type size in CSS.
pixels, percentages, ems
39
What CSS property controls the font used for the text inside an element?
font-family
40
What is the default flex-direction of a flex container?
row
41
What is the default flex-wrap of a flex container?
no-wrap
42
What are the four components of "the Cascade".
source order, inheritance, specificity, !important
43
What does the term "source order" mean with respect to CSS?
the order that css rulesets are written out in the css file determines what styling is applied. The LAST rule is what gets used.
44
How is it possible for the styles of an element to be applied to its children as well without an additional CSS rule?
some properties are inherited properties and will take the parent properties' value
45
List the three selector types in order of increasing specificity.
tag, class, id
46
Why is using !important considered bad practice?
disrupts the cascading nature of css which can make it difficult for debugging
47
Why do two div elements "vertically stack" on one another by default?
div is block level element so the second div goes under the first div due to divs taking up all the width of a page
48
What is the default flex-direction of an element with display: flex?
row
49
What is the default value for the position property of HTML elements?
static
50
How does setting position: relative on an element affect document flow?
moves an element in relation to where it would have been in normal flow.
51
How does setting position: relative on an element affect where it appears on the page?
by default won't move the element but can set offset with the 4 offset properties
52
How does setting position: absolute on an element affect document flow?
it removes itself from the flow of the document
53
How does setting position: absolute on an element affect where it appears on the page?
its offset is based off of its constraining element
54
How do you constrain an absolutely positioned element to a containing block?
set the containing block's position property to relative
55
What are the four box offset properties?
top, bottom, left, right
56
What is the purpose of variables?
to store a value for later usage
57
How do you declare a variable?
var, let, const
58
How do you initialize (assign a value to) a variable?
varName = value
59
What characters are allowed in variable names?
letters, digits, underscores, and dollar signs.
60
What does it mean to say that variable names are "case sensitive"?
different casing means different variables
61
What is the purpose of a string?
to describe text values
62
What is the purpose of a number?
to describe numeric values
63
What is the purpose of a boolean?
to describe true and false values
64
What does the = operator mean in JavaScript?
assignment operator
65
How do you update the value of a variable?
varName = value
66
What is the difference between null and undefined?
null is intentionally defined while undefined means a variable contains no value
67
Why is it a good habit to include "labels" when you log values to the browser console?
it is easy to lose track of which logs belongs to which variables
68
Give five examples of JavaScript primitives.
number, boolean, string, null, undefined
69
What data type is returned by an arithmetic operation?
number
70
What is string concatenation?
when two or more strings are added together
71
What purpose(s) does the + plus operator serve in JavaScript?
adds numbers together or concatenates strings together
72
What data type is returned by comparing two values (, ===, etc)?
boolean
73
What does the += "plus-equals" operator do?
adds variable's value to operand and reassings the value to itself
74
What are objects used for?
group a set of variables and functions to model after real world objects
75
What are object properties?
variables in an object
76
Describe object literal notation.
{ property: value, property: value }
77
How do you remove a property from an object?
delete keyword in front of the dot notation of the property of the object you want to delete
78
What are the two ways to get or update the value of a property?
dot notation or square brackets
79
What are arrays used for?
store a list of values
80
Describe array literal notation.
[val1,val2,val3]
81
How are arrays different from "plain" objects?
used to store data that are related, array also preserves order, numeric indexing
82
What number represents the first index of an array?
0
83
What is the length property of an array?
contains the number of elements in an array
84
How do you calculate the last index of an array?
array.length - 1
85
What is a function in JavaScript?
reusable code that can be repeatedly called for different situations
86
Describe the parts of a function definition.
function keyword, function name, parameters, code block
87
Describe the parts of a function call.
function name, arguments
88
When comparing them side-by-side, what are the differences between a function call and a function definition?
function definition defines the code block and parameters of the function while function call runs the code block with the given arguments
89
What is the difference between a parameter and an argument?
parameters are what arguments will be assigned to when passed into the function call
90
Why are function parameters useful?
allows a code block to be more dynamic depending on the input arguments
91
What two effects does a return statement have on the behavior of a function?
produces a value from function code block and stops running any additional code from the function code block
92
Why do we log things to the console?
to check if our code is running with intended behavior
93
What is a method?
a function property of an object
94
How is a method different from any other function?
methods are called with its containing object or object constructor
95
How do you remove the last element from an array?
array.pop()
96
How do you round a number down to the nearest integer?
Math.floor()
97
How do you generate a random number?
Math.random()
98
How do you delete an element from an array?
array.splice()
99
How do you append an element to an array?
array.push()
100
How do you break a string up into an array?
string.split()
101
Do string methods change the original string? How would you check if you weren't sure?
no, strings are immutable in JS, can console log the string
102
Roughly how many string methods are there according to the MDN Web docs?
36
103
Is the return value of a function or method useful in every situation?
no sometimes you only need the functionality of the function/method
104
Roughly how many array methods are there according to the MDN Web docs?
38
105
What three-letter acronym should you always include in your Google search about a JavaScript method or CSS property?
MDN
106
What is the purpose of a loop?
to run a code block multiple times until a condition is met
107
What is the purpose of a condition expression in a loop?
it lets the for loop know when to stop running
108
What does "iteration" mean in the context of loops?
each full run through of the for loop code block
109
When does the condition expression of a while loop get evaluated?
when first entering the while loop and in the beginning of every iteration
110
When does the initialization expression of a for loop get evaluated?
before the first iteration of the for loop
111
When does the condition expression of a for loop get evaluated?
before each iteration of the for loop
112
When does the final expression of a for loop get evaluated?
at the end of each iteration of the for loop
113
Besides a return statement, which exits its entire function block, which keyword exits a loop before its condition expression evaluates to false?
break
114
What does the ++ increment operator do?
increments the value of its operand by 1
115
How do you iterate through the keys of an object?
for(let keys in object)
116
Give 6 examples of comparison operators.
,<=,>=,===,==,!==
117
What data type do comparison expressions evaluate to?
boolean
118
What is the purpose of an if statement?
to check a condition to determine if a specific code block should run
119
Is else required in order to use an if statement?
no
120
Describe the syntax (structure) of an if statement.
if(condition){ code }
121
What are the three logical operators?
&&. || , !
122
How do you compare two different expressions in the same condition?
have each expression in paraenthesis
123
Why do we log things to the console?
to check if our code is running with the intended logic or values
124
What is a "model"?
a representation of an object or idea
125
What is the word "object" referring to in the phrase Document Object Model?
the objects within the DOM tree or each element of the page
126
What is a DOM Tree?
the document object representation of the entire page
127
Give two examples of document methods that retrieve a single element from the DOM.
document.querySelector('h1'), document.querySelector('body')
128
Give one example of a document method that retrieves multiple elements from the DOM at once.
document.querySelectorAll('p')
129
Why might you want to assign the return value of a DOM query to a variable?
so you can alter its properties
130
Why might you want to assign the return value of a DOM query to a variable?
so you can alter its properties, the bigger document gets, the longer it'll take for the query selectors to look thru to find the elements so saving elements that you will access more than once is efficient
131
Why would a tag need to be placed at the bottom of the HTML content instead of at the top?
it ensures all of the DOM is loaded properly before being accessed within the script
132
What does document.querySelector() take as its argument and what does it return?
a css selector and returns the first element matches
133
What does document.querySelectorAll() take as its argument and what does it return?
a css selector and returns all matching elements
134
What does document.querySelectorAll() take as its argument and what does it return?
a css selector and returns all matching elements as a NodeList
135
NodeList vs Arrays
NodeLists are array-like but are not arrays, happens to contain some similar methods/properties
136
Why do we log things to the console?
to check if our code is running with the intended logic or values
137
What is the purpose of events and event handling?
to programtically respond to changes or actions on the webpage
138
Are all possible parameters required to use a JavaScript method or function?
no
139
What method of element objects lets you set up a function to be called when a specific type of event occurs?
addEventListener
140
What is a callback function?
a function that is passed into another function as an argument that can be invoked later
141
What object is passed into an event listener callback when the event fires?
an event object
142
What is the event.target? If you weren't sure, how would you check? Where could you get more information about it?
reference to the object that the event was dispatched on. Use MDN to check info on it
143
What is the difference between these two snippets of code? element. addEventListener('click', handleClick) element. addEventListener('click', handleClick())
one passes in the callback function handleClick as an argument, one passes in the return value of the function handleClick as an argument
144
What is the className property of element objects?
gives the value of the class attribute of the element
145
How do you update the CSS class attribute of an element using JavaScript?
element.className = newName
146
What is the textContent property of element objects?
contains only the text content of an element
147
How do you update the text within an element using JavaScript?
element.textContent = new text
148
Is the event parameter of an event listener callback always useful?
no sometimes you just want the callback to run specific code regardless of the event's data
149
Would this assignment be simpler or more complicated if we didn't use a variable to keep track of the number of clicks?
harder
150
Why is storing information about a program in variables better than only storing it in the DOM?
the larger the DOM gets the longer it'll take to find elements with query selectors so storing them in variables improves efficiency
151
What does the transform property do?
rotate, scale, skew, or translate
152
Give four examples of CSS transform functions.
translate(), rotate(),scale(), skew()
153
The transition property is shorthand for which four CSS properties?
transition-property, transition-duration, transition-timing-function, and transition-delay.
154
What event is fired when a user places their cursor in a form control?
focus
155
What event is fired when a user's cursor leaves a form control?
blur
156
What event is fired as a user changes the value of a form control?
input
157
What event is fired when a user clicks the "submit" button within a ?
submit
158
What does the event.preventDefault() method do?
prevents an event from being handled using its default behavior
159
What does submitting a form without event.preventDefault() do?
reloads the page with the form's values
160
What property of a form element object contains all of the form's controls.
elements
161
What property of a form control object gets and sets its value?
value
162
What is an advantage of having your console open when writing a JavaScript program?
allows you to debug at each step of your code
163
Does the document.createElement() method insert a new element into the page?
no
164
How do you add an element as a child to another element?
appendChild()
165
What do you pass as the arguments to the element.setAttribute() method?
the attribute you want to set and the value to set it to
166
What steps do you need to take in order to insert a new element into the page?
create the element, set its attributes/set its textContent depending on if they need them, append the element to an element on the page
167
What is the textContent property of an element object for?
the text inside an element
168
Name two ways to set the class attribute of a DOM element.
setAttribute(), or className property
169
What are two advantages of defining a function to do create something (like the work of creating a DOM tree)?
reusability, allows for dynamic usage by passing in arguments
170
Give two examples of media features that you can query in an @media rule.
any-hover, any-pointer
171
Which HTML meta tag is used in mobile-responsive web pages?
viewport
172
What is the event.target?
the target of the event
173
What is the event.target?
the target of the event
174
What DOM element property tells you what type of element it is?
tagName
175
What does the element.closest() method take as its argument and what does it return?
takes a selector
176
How can you remove an element from the DOM?
element.remove()
177
If you wanted to insert new clickable DOM elements into the page using JavaScript, how could you avoid adding an event listener to every new element individually?
add it to the parent element
178
What is the event.target?
the target of the event
179
What is the affect of setting an element to display: none?
hides the element
180
What does the element.matches() method take as an argument and what does it return?
a string selector, returns a boolean
181
How can you retrieve the value of an element's attribute?
getAttribute()
182
At what steps of the solution would it be helpful to log things to the console?
every
183
If you were to add another tab and view to your HTML, but you didn't use event delegation, how would your JavaScript code be written instead?
need to add event listeners to every single view and tab
184
If you didn't use a loop to conditionally show or hide the views in the page, how would your JavaScript code be written instead?
an if statement for every view/tab
185
What is a breakpoint in responsive Web design?
The points at which a media query is introduced
186
hat is the advantage of using a percentage (e.g. 50%) width instead of a fixed (e.g. px) width for a "column" class in a responsive layout?
it makes it so the width can scale based on device's width rather than flat size
187
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?
source order
188
What is JSON?
JavaScript Object Notation
189
What are serialization and deserialization?
translating object in memory into stream of bytes and vice versa
190
Why are serialization and deserialization useful?
store data on disk or send across network
191
How do you serialize a data structure into a JSON string using JavaScript?
JSON.stringify(string)
192
How do you deserialize a JSON string into a data structure using JavaScript?
JSON.parse(string)
193
How to you store data in localStorage?
setItem(key,value)
194
How to you retrieve data from localStorage?
getItem(key)
195
What data type can localStorage save in the browser?
DOMString
196
When does the 'beforeunload' event fire on the window object?
when the window, document, and its resources are about to be unloaded
197
What is a method?
function of an object
198
Describe method definition syntax (structure).
``` functionName: function() { function code block; } ```
199
Describe method call syntax (structure).
object.method(arguments);
200
How is a method different from any other function?
methods can only be called with the object it is associated with
201
What is the defining characteristic of Object-Oriented Programming?
objects can contain both data and behavior as properties and methods respectively
202
What are the four "principles" of Object-Oriented Programming?
abstraction, encapsulation, inheritance, polymorphism
203
What is "abstraction"?
being able to work with complex things in a simple ways
204
What does API stand for?
application programming interface
205
What is the purpose of an API?
gives programmers a way to interact with a system in a simple way
206
What is this in JavaScript?
implicit parameter of all functions in javascript
207
What does it mean to say that this is an "implicit parameter"?
a parameter that isn't explicity passed in as an argument
208
When is the value of this determined in a function; call time or definition time?
call time
209
``` What does this refer to in the following code snippet? var character = { firstName: 'Mario', greet: function () { var message = 'It\'s-a-me, ' + this.firstName + '!'; console.log(message); } }; ```
character
210
Given the above character object, what is the result of the following code snippet? Why? character.greet();
It's-a-me, Mario! | because this in this case is character so character.firstName is 'Mario'
211
``` Given the above character object, what is the result of the following code snippet? Why? var hello = character.greet; hello(); ```
It's-a-me, undefined! | the implicit parameter in this case is window and window does not have a property firstName
212
How can you tell what the value of this will be for a particular function or method definition?
this refers to the object it is defined in
213
How can you tell what the value of this is for a particular function or method call?
the object that calls the method during runtime
214
What kind of inheritance does the JavaScript programming language use?
prototypal
215
What is a prototype in JavaScript?
a JavaScript object used to let other JavaScript objects inherit its properties/methods
216
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?
they are borrowed from the prototype object
217
If an object does not have it's own property or method by a given key, where does JavaScript look for it?
in its prototype
218
What does the new operator do?
creates a new instance of an object using its constructor function 1. creates blank JS object, 2. connects it to prototype chain by adding __proto__ 3. binds newly created object instance as the this context 4. returns newly created object
219
What property of JavaScript functions can store shared behavior for instances created with new?
prototype
220
What does the instanceof operator do?
checks if an object contains the constructor of the specified prototype and returns a boolean
221
What is a "callback" function?
a function thats passed in to another function as an argument to be called later
222
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()
223
How can you set up a function to be called repeatedly without using a loop?
setInterval()
224
What is the default time delay if you omit the delay parameter from setTimeout() or setInterval()?
0
225
What do setTimeout() and setInterval() return?
an ID
226
What is a client?
service requester
227
What is a server?
provider of a resource or service
228
Which HTTP method does a browser issue to a web server when you visit a URL?
GET
229
What three things are on the start-line of an HTTP request message?
HTTP method, request target, HTTP version
230
What three things are on the start-line of an HTTP response message?
protocol version, status code, status text
231
What are HTTP headers?
describes the request or body included in the message
232
Where would you go if you wanted to learn more about a specific HTTP Header?
MDN
233
Is a body required for a valid HTTP request or response message?
no
234
What is a code block? What are some examples of a code block?
Code block is code written between curly braces. | Examples: if, else, for, while
235
What does block scope mean?
block scope describes variables that exist within a specific code block
236
What is the scope of a variable declared with const or let?
block /local
237
What is the difference between let and const?
const prevents reassignment to the variable
238
Why is it possible to .push() a new value into a const variable that points to an Array?
you can modify the values within the variable but not what the variable refers to
239
How should you decide on which type of declaration to use?
use let if you plan on modifying the data, use const if you don't
240
What is the syntax for writing a template literal?
`string ${varname}`
241
What is "string interpolation"?
substituting parts of a string with values from variables or expressions
242
What is destructuring, conceptually?
Object destructuring assigns the properties of an object to variables with the same names by default.
243
What is the syntax for Object destructuring?
let {property1, property2...} = object
244
What is the syntax for Array destructuring?
let [x, y, z] = array
245
How can you tell the difference between destructuring and creating Object/Array literals?
destructuring syntax happens on the left side of the assignment operator
246
What is the syntax for defining an arrow function?
(parameters) => {}
247
When an arrow function's body is left without curly braces, what changes in its functionality?
the value of the expression is returned
248
How is the value of this determined within an arrow function?
an arrow function captures the this value of the enclosing context instead of creating its own this context
249
What is Node.js?
Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine.
250
What can Node.js be used for?
backend javascript
251
What is a REPL?
What does REPL mean? | read-eval-print loop
252
When was Node.js created?
May 27, 2009
253
What back end languages have you heard of?
Python, Ruby, PHP
254
What is a computer process?
computer program running on one or multiple threads that contain the programs code
255
Roughly how many computer processes are running on your host operating system (Task Manager or Activity Monitor)?
150
256
Why should a full stack Web developer know that computer processes exist?
helpful for when debugging backend servers
257
What is the process object in a Node.js program?
The process object is a global that provides information about, and control over, the current Node.js process
258
How do you access the process object in a Node.js program?
process
259
What is the data type of process.argv in Node.js?
array
260
What is a JavaScript module?
a js file
261
What values are passed into a Node.js module's local scope?
``` __dirname __filename exports module require() ``` these are scope isolated, unique to each module
262
Give two examples of truly global variables in a Node.js program.
process, console
263
What is the purpose of module.exports in a Node.js module?
to bring variables and data from js file to another
264
How do you import functionality into a Node.js module from another Node.js module?
require()
265
What is the JavaScript Event Loop?
event loop is responsible for pushing anything in the task queue on to the call stack when call stack is empty
266
What is different between "blocking" and "non-blocking" with respect to how code is executed?
blocking is code that runs synchronously from call stack, non-blocking are code that get pushed onto the task queue and pushed on to call stack when call stack is empty
267
What is a directory?
folder
268
What is a relative file path?
path relative to your current directory
269
What is an absolute file path?
the full path to a file or directory
270
What module does Node.js include for manipulating the file system?
fs
271
What method is available in the Node.js fs module for writing data to a file?
fs.writeFile()
272
Are file operations using the fs module synchronous or asynchronous?
async
273
What is a client?
service requester
274
What is a server?
service provider
275
Which HTTP method does a browser issue to a web server when you visit a URL?
GET
276
What is on the first line of an HTTP request message?
http method, request target, http version
277
What is on the first line of an HTTP response message?
protocol version, status code, status text
278
What are HTTP headers?
describes the request or body included in the message
279
Is a body required for a valid HTTP message?
no
280
What is NPM?
Node Package Manager
281
What is a package?
a directory with one or more files in it that also includes package.json
282
How can you create a package.json with npm?
npm init
283
What is a dependency and how to you add one to a package?
packages your package needs to run. | npm i package
284
What happens when you add a dependency to a package with npm?
it installs it to the local node_module folder
285
How do you add express to your package dependencies?
npm install express
286
What Express application method starts the server and binds it to a network PORT?
listen
287
How do you mount a middleware with an Express application?
use method
288
Which objects does an Express application pass to your middleware to manage the request/response lifecycle of the server?
request, response, next
289
What is the appropriate Content-Type header for HTTP messages that contain JSON in their bodies?
application/json
290
What is the significance of an HTTP request's method?
indicates the intended behavior of the api request
291
What does the express.json() middleware do and when would you need it?
express.json() returns a json parsing middleware that only parses JSON
292
What is PostgreSQL and what are some alternative relational databases?
an Relational database management system | MySQL, Oracle
293
What are some advantages of learning a relational database?
most relational databases use sql so it is a portable skill, help prevent data corruption through rigid table structure
294
What is one way to see if PostgreSQL is running?
top
295
What is a database schema?
a collection of tables. How the tables are set up
296
What is a table?
a list of rows
297
What is a row?
sets of attributes
298
What is SQL and how is it different from languages like JavaScript?
SQL is an declarative language used for interacting with relational databases
299
How do you retrieve specific columns from a database table?
select "nameOfColumn"
300
How do you filter rows based on some specific criteria?
where
301
What are the benefits of formatting your SQL?
legibility
302
What are four comparison operators that can be used in a where clause?
= < > !=
303
How do you limit the number of rows returned in a result set?
limit number
304
How do you retrieve all columns from a database table?
select *
305
How do you control the sort order of a result set?
order by colName asc/desc
306
How do you add a row to a SQL table?
insert into "tablename" ("colName") | values ('whateverValue')
307
What is a tuple?
group of data
308
How do you add multiple rows to a SQL table at once?
add commas between each tuple
309
How do you get back the row being inserted into a table without a separate select statement?
returning *
310
How do you delete rows from a database table?
delete from "tableName" | where condition;
311
How do you accidentally delete all rows from a table?
delete from "tableName";
312
What is a foreign key?
refers to another key in a different table
313
How do you join two SQL tables?
join "tableName" using ("colName")
314
How do you temporarily rename columns or tables in a SQL statement?
"colName" as "alias"
315
What are some examples of aggregate functions?
max(), min(), sum(), every()
316
What is the purpose of a group by clause?
used to group values into a single row such as results from aggregate functions
317
What are the three states a Promise can be in?
pending, fulfilled, rejected
318
How do you handle the fulfillment of a Promise?
.then
319
How do you handle the rejection of a Promise?
.catch
320
What is Array.prototype.filter useful for?
removing unwanted elements from an array
321
What is Array.prototype.map useful for?
returning a new array with every element being the result of the callback function
322
What is Array.prototype.reduce useful for?
consolidate all values of an array into a single value
323
What is "syntactic sugar"?
sytntax that makes the language easier to read or use
324
What is the typeof an ES6 class?
function
325
Describe ES6 class syntax.
``` class ClassName{ constructor() { } } ```
326
What is Webpack?
js bundler
327
What is Webpack?
bundles multiple modules into a single JavaScript file.
328
What is an NPM script?
bundle common shell commands
329
How do you execute Webpack with npm run?
inside scripts add webpack as a value of build
330
How are ES Modules different from CommonJS modules?
import vs require | export default vs module.exports
331
What kind of modules can Webpack support?
CommonJS and ES Modules
332
What is React?
a JavaScript library for creating user interfaces.
333
What is a React element?
DOM object created by React
334
How do you mount a React element to the DOM?
ReactDOM.render(element, container)
335
What is Babel?
JavaScript compiler that makes ECMAScript 2015+ backwards compatible
336
What is a Plug-in?
a software component that adds a specific feature to an existing program
337
What is a Webpack loader?
allows for pre-processing of the files as you import or “load” them
338
How can you make Babel and Webpack work together?
babel-loader
339
What is JSX?
JavaScript extension that produces React Elements
340
Why must the React object be imported when authoring JSX in a module?
JSX uses React.createElement()
341
Why must the React object be imported when authoring JSX in a module?
babel compiles JSX down to React.createElement() calls
342
How can you make Webpack and Babel work together to convert JSX into valid JavaScript?
plugin-transform-react-jsx plugin for babel-loader
343
What is a React component?
classes or functions that accepts props and returns React elements
344
How do you define a function component in React?
``` function ComponentName (props){ //code block; } ```
345
How do you mount a component to the DOM?
ReactDOM.render(component, container)
346
What are props in React?
arguments passed into React components
347
How do you pass props to a component?
as an argument to the component
348
How do you write JavaScript expressions in JSX?
{ some expression}
349
How do you create "class" component in React?
``` class ComponentName extends React.Component{ render(){ ``` } }
350
How do you access props in a class component?
this.props
351
What is the purpose of state in React?
State is similar to props, but it is private and fully controlled by the component.
352
How to you pass an event handler to a React element?
{this.handleName}
353
Is setState sync or async
async, do not call console log after setState
354
What are controlled components?
components that update own states based on user inputs and also use React's state as single point of truth
355
What two props must you pass to an input for it to be "controlled"?
onChange | value
356
What Array method is commonly used to create a list of React elements?
map
357
What is the best value to use as a "key" prop when rendering lists?
an id
358
accordian vs carousel
both be dynamic accordion should work with any title and detail coursel should work with any images
359
What does express.static() return?
a function
360
What is the local __dirname variable in a Node.js module?
dynamically generated absolute file path of current file
361
What does the join() method of Node's path module do?
joins two path names together into one path
362
What does fetch() return?
a promise that resolves into a response object
363
What is the default request method used by fetch()?
get
364
What is the default request method used by fetch()?
pass a config object as the second argument with method property specified
365
When does React call a component's componentDidMount method?
immediately after a component is inserted into the DOM tree
366
Name three React.Component lifecycle methods.
componentDidMount, componentDidUpdate, componentDidWillUnmount
367
How do you pass data to a child component?
props
368
What does the acronym LIFO mean?
last in first out
369
What methods are available on a Stack data structure?
push pop
370
What must you do to access the value at an arbitrary point in a stack (not just the "top")?
pop
371
What must the return value of myFunction be if the following expression is possible? myFunction()();
a function
372
``` What does this code do? const wrap = value => () => value; ```
wrap is assigned the function () => value
373
In JavaScript, when is a function's scope determined; when it is called or when it is defined?
when it is called
374
What allows JavaScript functions to "remember" values from their surroundings?
closures
375
What does the acronym FIFO mean?
first in first out
376
What methods are available on a Queue data structure?
enqueue, dequeue, peek
377
What must you do to access the value at an arbitrary point in a queue (not just the "front")?
dequeue
378
How are linked lists different from an array?
it's not indexed
379
How would you access an arbitrary node in a linked list (not just the "head")?
next