Quiz Questions Flashcards

1
Q

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

A

on the “head” 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

on the “body” tag

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

between the “HTML” tags.

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

for the browsers to know which type of HTML it is.

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

h1,h2,h3,p,span,head,body etc

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 extra information about the HTML

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

less than or greater than

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

they take up the whole space/appear on the 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

they only take as much as they need/continue on the same line

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: 100%
height: as much as needed

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

whatever is needed.

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

Ordered list comes with numbering while unordered list comes with bullet point.

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

it is a block element.

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

“a” tag

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

What is an absolute URL?

A

actual location to the site

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

What is a relative URL?

A

relative path to the source. for instance, a source located on the same server but on a different level.

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

add “../” (go up one directory to parent)

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

go directly in. just input the file name

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

add “../../”

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

type the final file name

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

group inputs together and utilization of the data. (collecting data)

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

adding text, choosing option, submitting form, uploading files, drop down

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

password,text,radio

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, tr, td, th, thead, tbody, tfoot
26
What purpose do the thead and tbody elements serve?
allows us to style in different method, easier for people using screen reader.
27
Give two examples of data that would lend itself well to being displayed in a table.
schedules, tabular data
28
What are the names of the individual pieces of a CSS rule?
selector, declaration block
29
In CSS, how do you select elements by their class attribute?
adding a "."
30
In CSS, how do you select elements by their type?
name itself
31
In CSS, how do you select an element by its id attribute?
add an hastag (you dont really wanna use id for css styling)
32
what are the three ways to specify color in CSS?
hex, rgb, built in value
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?
keyword added to a selector that specifies a special state of the selected element
37
What are CSS pseudo-classes useful for?
give added functionality. | more customization
38
Name at least two units of type size in CSS.
pixels, percentage,(r)em
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?
horizontal (row)
41
What is the default flex-wrap of a flex container?
no wrap
42
What is the default value for the position property of HTML elements?
static
43
How does setting position: relative on an element affect document flow?
no effect on doc flow
44
How does setting position: relative on an element affect where it appears on the page?
relative to where it would be (based on original place)
45
How does setting position: absolute on an element affect document flow?
moves it from the doc page
46
How does setting position: absolute on an element affect where it appears on the page?
attaches to the parents position
47
How do you constrain an absolutely positioned element to a containing block?
make the container non-static
48
What are the four box offset properties?
top bottom left right.
49
What is the purpose of variables?
to store information
50
How do you declare a variable?
var (name of var) = ""
51
How do you initialize (assign a value to) a variable?
assignment operator "= "
52
What characters are allowed in variable names?
_ , $ no numerals at the beginning / no space
53
What is the purpose of a number?
determining the values
54
What is the purpose of a boolean?
to determine which script should run.
55
What does the = operator mean in JavaScript?
equal. setting the value
56
How do you update the value of a variable?
set a new valuee
57
What does the = operator mean in JavaScript?
equal. setting the value / assignment operator
58
How do you update the value of a variable?
set a new value
59
What is the difference between null and undefined?
null: invalid object/ intentional empty value undefined: no argument (type undefined) / unintentional no value.
60
Why is it a good habit to include "labels" when you log values to the browser console?
easy to go thru
61
What data type is returned by an arithmetic operation?
number
62
What is string concatenation?
adding two strings together
63
What purpose(s) does the + plus operator serve in JavaScript?
addition, concatenation
64
What data type is returned by comparing two values (, ===, etc)?
boolean value
65
What does the += "plus-equals" operator do?
x+=y -> | x = x+y
66
What are objects used for?
to model real life object
67
What are object properties?
variables within the object
68
Describe object literal notation.
var (name) = { | properties : value }
69
How do you remove a property from an object?
use delete operator
70
What are the two ways to get or update the value of a property?
. or []
71
What are arrays used for?
to store list of data
72
Describe array literal notation.
[ ]
73
How are arrays different from "plain" objects?
they have orders
74
What number represents the first index of an array?
0
75
What is the length property of an array?
measures the length of the array
76
How do you calculate the last index of an array?
array.length -1
77
What is a function in JavaScript?
object that can be called and execute the code block.
78
Describe the parts of a function definition.
function + name of the function + (parameters) {code block}
79
Describe the parts of a function call.
function name with ( )
80
When comparing them side-by-side, what are the differences between a function call and a function definition?
function definition defines the function, while calling the function actually execute the defined function.
81
What is the difference between a parameter and an argument?
parameter is the placeholder for the argument
82
Why are function parameters useful?
it could be modified
83
Why are function parameters useful?
it allows function to pass on
84
Why do we log things to the console?
to check the result
85
What is a method?
function which is a property of an object.
86
How is a method different from any other function?
built into the object
87
How do you remove the last element from an array?
pop()
88
How do you round a number down to the nearest integer?
math.round
89
How do you generate a random number?
math.random
90
How do you delete an element from an array?
splice
91
How do you append an element to an array?
push
92
How do you break a string up into an array?
split
93
Do string methods change the original string? How would you check if you weren't sure?
no. and use console.log
94
Roughly how many string methods are there according to the MDN Web docs?
~40
95
Is the return value of a function or method useful in every situation?
no
96
Roughly how many array methods are there according to the MDN Web docs?
~30
97
What three-letter acronym should you always include in your Google search about a JavaScript method or CSS property?
MDN
98
Give 6 examples of comparison operators.
== , != , === , !==, >,
99
What data type do comparison expressions evaluate to?
boolean
100
What is the purpose of an if statement?
to see whether the condition is met
101
Is else required in order to use an if statement?
no
102
Describe the syntax (structure) of an if statement.
if (condition) {"code block"}
103
What are the three logical operators?
&& (both needs to be true) || (either one) ! (inverts the boolean value)
104
How do you compare two different expressions in the same condition?
logical operator
105
What is the purpose of a loop?
to check the condition and run til it meets the condition.
106
What is the purpose of a condition expression in a loop?
serves as a counter (how many time it will run)
107
What does "iteration" mean in the context of loops?
each execution
108
When does the condition expression of a while loop get evaluated?
before the condition expression
109
When does the initialization expression of a for loop get evaluated?
evaluated once before the iteration
110
When does the condition expression of a for loop get evaluated?
after the final expression.
111
When does the final expression of a for loop get evaluated?
after the iteration
112
Besides a return statement, which exits its entire function block, which keyword exits a loop before its condition expression evaluates to false?
break
113
What does the ++ increment operator do?
increment
114
How do you iterate through the keys of an object?
for .. in loop
115
What are the four components of "the Cascade".
inheritance source order specificity position
116
What does the term "source order" mean with respect to CSS?
priority on which style gets applied
117
How is it possible for the styles of an element to be applied to its children as well without an additional CSS rule?
inheritance
118
List the three selector types in order of increasing specificity.
type
119
Why is using !important considered bad practice?
it can override the specificity
120
Why do we log things to the console?
to see the result. checkpoint
121
What is a "model"?
recreation of something.DOM tree, it is stored in the browsers' memory. consists of 4 main types of nodes.
122
Which "document" is being referred to in the phrase Document Object Model?
HTML doc. entire page/ object
123
What is the word "object" referring to in the phrase Document Object Model?
element
124
What is a DOM Tree?
the model made of objects
125
Give two examples of document methods that retrieve a single element from the DOM.
getElementByID() | querySelector()
126
Give one example of a document method that retrieves multiple elements from the DOM at once.
getElementsByClassName() getElementsByTagName() querySelectorAll()
127
Why might you want to assign the return value of a DOM query to a variable?
to save the browser looking through the DOM tree to find the same element again.
128
What console method allows you to inspect the properties of a DOM element object?
console.dir()
129
Why would a tag need to be placed at the bottom of the HTML content instead of at the top?
so that javascript loads after the HTML
130
What does document.querySelector() take as its argument and what does it return?
class,id, element, css selector | gives the location of the node
131
What does document.querySelectorAll() take as its argument and what does it return?
class,id,element,css selector return in Node list (array like object) gives out the whole elements within the DOM
132
Why do we log things to the console?
to see the result
133
What is the purpose of events and event handling?
for the user interaction with the page.
134
What do [] square brackets mean in function and method syntax documentation?
optional
135
What method of element objects lets you set up a function to be called when a specific type of event occurs?
addEventListener()
136
What is a callback function?
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
137
What object is passed into an event listener callback when the event fires?
event object
138
What is the event.target? If you weren't sure, how would you check? Where could you get more information about it?
where the interaction occurred. debugger.
139
What is the difference between these two snippets of code?
2nd one will load right up. (one with the ()) so don't put ().
140
What is the className property of element objects?
string with the associated element
141
How do you update the CSS class attribute of an element using JavaScript?
using className method
142
What is the textContent property of element objects?
represents the text content of the element property and its descendants.
143
How do you update the text within an element using JavaScript?
element.textContent =' '
144
Is the event parameter of an event listener callback always useful?
no
145
Would this assignment be simpler or more complicated if we didn't use a variable to keep track of the number of clicks?
more complicated
146
Why is storing information about a program in variables better than only storing it in the DOM?
quicker access / securiity
147
What does the transform property do?
property lets you rotate, scale, skew, or translate an element
148
Give four examples of CSS transform functions.
rotate,scale,skew, translate
149
What event is fired when a user places their cursor in a form control?
focus
150
What event is fired when a user's cursor leaves a form control?
blur
151
What event is fired as a user changes the value of a form control?
input
152
What event is fired when a user clicks the "submit" button within a ?
submit
153
What does the event.preventDefault() method do?
prevents page from reloading to a blank page.
154
What does submitting a form without event.preventDefault() do?
it will erase all the text area
155
What is one risk of writing a lot of code without checking to see if it works so far?
it might not work
156
What is an advantage of having your console open when writing a JavaScript program?
to check everytime
157
Does the document.createElement() method insert a new element into the page?
no, the element node is stored in a variable.
158
How do you add an element as a child to another element?
appendChild()
159
What steps do you need to take in order to insert a new element into the page?
create element , create text node(optional, but recommended), append text to element, appendChild()
160
What is the textContent property of an element object for?
to be added to the element node
161
What do you pass as the arguments to the element.setAttribute() method?
name, value
162
Name two ways to set the class attribute of a DOM element.
set attribute, class Name
163
What are two advantages of defining a function to do create something (like the work of creating a DOM tree)?
easy/ time efficient
164
The transition property is shorthand for which four CSS properties?
transition-property, transition-duration, transition-timing-function, and transition-delay.
165
Give two examples of media features that you can query in an @media rule.
width ; height
166
Which HTML meta tag is used in mobile-responsive web pages?
view-port
167
What is the event.target?
location of event being fired
168
Why is it possible to listen for events on one element that actually happen its descendent elements?
event bubbling
169
What DOM element property tells you what type of element it is?
tag name
170
What does the element.closest() method take as its argument and what does it return?
takes in selector, returns itself or closest parent.
171
How can you remove an element from the DOM?
remove()
172
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?
addEventListener to the parent.
173
What is the event.target?
element that was interacted with the event
174
What is the affect of setting an element to display: none?
you cant see it
175
What does the element.matches() method take as an argument and what does it return?
takes in string represent; returns boolean value
176
How can you retrieve the value of an element's attribute?
getAttribute()
177
At what steps of the solution would it be helpful to log things to the console?
as much as possible
178
If you were to add another tab and view to your HTML, but you didn't use event delegation, how would your JavaScript code be written instead?
multiple event listener
179
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?
series of conditional statements
180
What is a breakpoint in responsive Web design?
The points at which a media query is introduced
181
What 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?
because it goes with ratio
182
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?
specificity will override the later one .
183
What is JSON?
text-based data format following JavaScript object syntax.
184
What are serialization and deserialization?
serialization : process of turning an object in memory into a stream of bytes so you can do stuff like store it on disk or send it over the network. deserialization : turning a stream of bytes into an object in memory.
185
Why are serialization and deserialization useful?
its useful to convert data type.
186
How do you serialize a data structure into a JSON string using JavaScript?
JSON.stringify()
187
How do you deserialize a JSON string into a data structure using JavaScript?
JSON.parse()
188
How to you store data in localStorage?
window.localStorage
189
How to you store data in localStorage?
localStorage.setItem()
190
What data type can localStorage save in the browser?
UTF-16 DOMstring
191
When does the 'beforeunload' event fire on the window object?
event is fired when the window, the document and its resources are about to be unloaded.
192
What is a method?
a function which is a property of an object / form of a procedure
193
How can you tell the difference between a method definition and a method call?
method def = writing the code for the function | method call = calling with argument
194
Describe method definition syntax (structure).
obj var , obj, property name, assigned function
195
Describe method call syntax (structure).
dot notation and call
196
How is a method different from any other function?
it is a property
197
What is the defining characteristic of Object-Oriented Programming?
objects can store the data and behave like a method
198
What does API stand for?
application programming interface
199
What is "abstraction"?
to be able to work with (possibly) complex things in simple ways
200
What is this in JavaScript?
implicit parameter of all JavaScript functions.
201
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 with var
202
When is the value of this determined in a function; call time or definition time?
when the function is called
203
What does this refer to in the following code snippet?
'character'
204
Given the above character object, what is the result of the following code snippet? Why?
Its a-me Mario
205
Given the above character object, what is the result of the following code snippet? Why?
its a-me undef
206
How can you tell what the value of this will be for a particular function or method definition?
when the function is called , take a look at the object that is left of the dot.
207
How can you tell what the value of this is for a particular function or method call?
whatever the function calls
208
How can you tell what the value of this will be for a particular function or method definition?
the object
209
How can you tell what the value of this is for a particular function or method call?
whatever the function called 'this'
210
What kind of inheritance does the JavaScript programming language use?
prototype-based inheritance
211
What is a prototype in JavaScript?
an object that has functionality that allows the objects to have the function
212
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?
we can add them
213
If an object does not have it's own property or method by a given key, where does JavaScript look for it?
prototype chain.
214
What does the new operator do?
lets developers create an instance of a user-defined object type or of one of the built-in object types that has a constructor function.
215
What does the instanceof operator do?
tests to see if the prototype property of a constructor appears anywhere in the prototype chain of an object.
216
What property of JavaScript functions can store shared behavior for instances created with new?
prototype
217
What is a "callback" function?
function passed into another function as an argument, which is then invoked inside the outer function to complete some kind of routine or action.
218
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?
setTimer()
219
How can you set up a function to be called repeatedly without using a loop?
setInterval
220
What is the default time delay if you omit the delay parameter from setTimeout() or setInterval()?
1000ms
221
What do setTimeout() and setInterval() return?
boolean
222
What is a client?
service requesters
223
What is a server?
providers of a resource or service
224
Which HTTP method does a browser issue to a web server when you visit a URL?
GET method
225
What three things are on the start-line of an HTTP request message?
http methods request target http version
226
What three things are on the start-line of an HTTP response message?
protocol version status code status text
227
What are HTTP headers?
specifying the request, or describing the body included in the message.
228
Where would you go if you wanted to learn more about a specific HTTP Header?
MDN
229
Is a body required for a valid HTTP request or response message?
No.
230
What is AJAX?
A technique for loading data into part of a page without having to refresh the entire page. asynchronous communication request.
231
What does the AJAX acronym stand for?
Asynchronous JavaScript and XML
232
Which object is built into the browser for making HTTP requests in JavaScript?
XMLHttpRequest.
233
What event is fired by XMLHttpRequest objects when they are finished loading the data from the server?
Event that can be used to trigger a javaScript function that will process the data and incorporate it. load event.
234
Bonus Question: An XMLHttpRequest object has an addEventListener() method just like DOM elements. How is it possible that they both share this functionality?
descendent of the same function so it gets inherited.
235
What is a code block? What are some examples of a code block?
{}
236
What is the scope of a variable declared with const or let?
block
237
What is the difference between let and const?
values can’t be reassigned.
238
What does block scope mean?
area within if, switch conditions or for and while loops
239
Why is it possible to .push() a new value into a const variable that points to an Array?
because CONST is immutable
240
How should you decide on which type of declaration to use?
if it needs to be mutable, use LET, if not, use CONST.
241
What is the syntax for Array destructuring?
let/const ["variables"] = "source array literal"
242
How can you tell the difference between destructuring and creating Object/Array literals?
if its happening on the left side, its restructuring. If its on the right, creation.
243
What is the syntax for writing a template literal?
backticks ``
244
What is "string interpolation"?
substituting string with the variable.
245
What is the syntax for writing a template literal?
backticks `${var_name}`
246
What is a CLI?
command-line interfaces.
247
What is a GUI?
graphical user interface
248
When an arrow function's body is left without curly braces, what changes in its functionality?
doesnt require a return
249
What are the three virtues of a great programmer?
laziness impatience hubris
250
What is the syntax for defining an arrow function?
(parameter) => {statement}
251
What is Node.js?
program that allows JavaScript to be run outside of a web browser
252
What can Node.js be used for?
commonly used to build back ends for Web applications, command-line programs, or any kind of automation that developers wish to perform
253
What is a REPL?
Read–eval–print loop
254
When was Node.js created?
2009
255
What back end languages have you heard of?
NaN
256
What is a computer process?
the instance of a computer program that is being executed by one or many threads.
257
Roughly how many computer processes are running on your host operating system (Task Manager or Activity Monitor)?
~450
258
Why should a full stack Web developer know that computer processes exist?
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.
259
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
260
How do you access the process object in a Node.js program?
node process
261
What is the data type of process.argv in Node.js?
array
262
What is a JavaScript module?
a single .js file.
263
Give two examples of truly global variables in a Node.js program.
__filename , __dirname
264
What values are passed into a Node.js module's local scope?
exports , require, module, __filename, __dirname
265
Give two examples of truly global variables in a Node.js program.
process, console.
266
What is the purpose of module.exports in a Node.js module?
transmit information within file
267
How do you import functionality into a Node.js module from another Node.js module?
assign to module.exports and assign require on the other file.
268
What is the JavaScript Event Loop?
executing the code, collecting and processing events, and executing queued sub-tasks.
269
What is different between "blocking" and "non-blocking" with respect to how code is executed?
blocking would stop the execution of the other code blocks.
270
What is a directory?
location of the file
271
What is a relative file path?
path of the file relative to the directory
272
What is an absolute file path?
full path of the file
273
What module does Node.js include for manipulating the file system?
fs
274
What method is available in the Node.js fs module for writing data to a file?
fs.writeFile
275
Are file operations using the fs module synchronous or asynchronous?
asynchronous
276
What is NPM?
world's largest software registry share packages
277
What is a package?
reusable codes. directory to the files including package.json
278
How can you create a package.json with npm?
npm init --yes
279
What is a dependency and how to you add one to a package?
Packages required by your application in production. | npm install.
280
What happens when you add a dependency to a package with npm?
it gets add to your package.json's dependency. node module gets downloaded.
281
How do you add express to your package dependencies?
npm install express
282
What Express application method starts the server and binds it to a network PORT?
listen method
283
How do you mount a middleware with an Express application?
'use' method
284
Which objects does an Express application pass to your middleware to manage the request/response lifecycle of the server?
req/res
285
What is the appropriate Content-Type header for HTTP messages that contain JSON in their bodies?
.json
286
What is the significance of an HTTP request's method?
it executes the desired action
287
What does the express.json() middleware do and when would you need it?
It parses incoming requests with JSON payloads and is based on body-parser. use it when we need to parse the data.
288
What is PostgreSQL and what are some alternative relational databases?
a powerful, open source object-relational database system. ex: MySQL (also free), SQL Server by Microsoft, and Oracle by Oracle Corporation.
289
What are some advantages of learning a relational database?
they support good guarantees about data integrity. They can store and modify data in a way that makes data corruption as unlikely as possible.
290
What is one way to see if PostgreSQL is running?
sudo service postgresql status
291
What is a database schema?
collection of tables
292
What is a table?
where Relational databases store data
293
What is a row?
each entries for the table contains attributes
294
What is SQL and how is it different from languages like JavaScript?
primary way of interacting with relational databases.SQL is a declarative programming language.
295
How do you retrieve specific columns from a database table?
Select statement
296
How do you filter rows based on some specific criteria?
where
297
What are the benefits of formatting your SQL?
readability
298
What are four comparison operators that can be used in a where clause?
= , > ,
299
How do you limit the number of rows returned in a result set?
limit
300
How do you retrieve all columns from a database table?
*
301
How do you control the sort order of a result set?
in order by (desc, ascending is default)
302
How do you add a row to a SQL table?
insert into
303
What is a tuple?
a list of values
304
How do you add multiple rows to a SQL table at once?
Data rows can be batch inserted into a database table by specifying more than one tuple of values, separated by commas
305
How do you get back the row being inserted into a table without a separate select statement?
returning * (or specify the column you want)
306
How do you update rows in a database table?
update clause
307
Why is it important to include a where clause in your update statements?
to only target specific rows.
308
How do you delete rows from a database table?
delete from
309
How do you accidentally delete all rows from a table?
if you dont use where clause.
310
What is a foreign key?
commonly shared column which links two or more tables
311
How do you join two SQL tables?
join clause
312
How do you temporarily rename columns or tables in a SQL statement?
"as" clause
313
What are some examples of aggregate functions?
max(),min(),avg()
314
What is the purpose of a group by clause?
grouping using one column
315
What are the three states a Promise can be in?
pending: initial state, neither fulfilled nor rejected. fulfilled: meaning that the operation was completed successfully. rejected: meaning that the operation failed.
316
How do you handle the fulfillment of a Promise?
use then method
317
How do you handle the rejection of a Promise?
use catch method
318
What is Array.prototype.filter useful for?
when going over the array and trying to find a desired value
319
What is Array.prototype.map useful for?
when applying function to the whole array values.
320
What is Array.prototype.reduce useful for?
when you need to merge the array.
321
What is "syntactic sugar"?
syntax within a programming language that is designed to make things easier to read or to express.
322
What is the typeof an ES6 class?
function
323
Describe ES6 class syntax.
Classes are a template for creating objects
324
What is "refactoring"?
the process of restructuring existing computer code—changing the factoring—without changing its external behavior.
325
What is Webpack?
a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser
326
How do you add a devDependency to a package?
npm install --save-dev (module)
327
What is an NPM script?
use scripts to automate repetitive tasks
328
How do you execute Webpack with npm run?
npm run build
329
How are ES Modules different from CommonJS modules?
``` Similar to CommonJS, they have a compact syntax, a preference for single exports and support for cyclic dependencies. Similar to AMD, they have direct support for asynchronous loading and configurable module loading. ```
330
What kind of modules can Webpack support?
ECMA 6, AMD
331
What is React?
A JavaScript library for building user interfaces
332
What is a React element?
object created using react
333
How do you mount a React element to the DOM?
reactDom.render(element,container)
334
What is Babel?
Babel is a toolchain that is mainly used to convert ECMAScript 2015+ code into a backwards compatible version of JavaScript in current and older browsers or environments
335
What is a Plug-in?
is a software component that adds a specific feature to an existing computer program
336
What is a Webpack loader?
transformations that are applied to the source code of a module
337
How can you make Babel and Webpack work together?
loader, webpack.config.js
338
What is JSX?
syntax extension to JavaScript.
339
Why must the React object be imported when authoring JSX in a module?
to find it helpful as a visual aid when working with UI inside the JavaScript code. It also allows React to show more useful error and warning messages.
340
How can you make Webpack and Babel work together to convert JSX into valid JavaScript?
webpack.config.js
341
What is a React component?
Components let you split the UI into independent, reusable pieces, and think about each piece in isolation.
342
How do you define a function component in React?
write a function as you would do in JavaScript
343
How do you mount a component to the DOM?
ReactDOM.render(file, container)
344
What are props in React?
object argument with data and returns a React element
345
How do you pass props to a component?
component name = value
346
How do you write JavaScript expressions in JSX?
by surrounding it with {}
347
How do you create "class" component in React?
StartWithCapitalLetter extend React.Component: | render()
348
How do you access props in a class component?
this.
349
What is the purpose of state in React?
State is similar to props, but it is private and fully controlled by the component.
350
How do you pass an event handler to a React element?
use attribute. React events are named using camelCase, rather than lowercase. With JSX you pass a function as the event handler, rather than a string.
351
What Array method is commonly used to create a list of React elements?
map
352
What is the best value to use as a "key" prop when rendering lists?
use a string that uniquely identifies a list item among its siblings
353
What are controlled components?
An input form element whose value is controlled by React
354
What two props must you pass to an input for it to be "controlled"?
handleChange, handleSubmit
355
What does express.static() return?
returns middleware
356
What is the local __dirname variable in a Node.js module?
returns abs path | directory name of the current file
357
What does the join() method of Node's path module do?
combines the path into one
358
What does fetch() return?
it returns a promise containing the response
359
What is the default request method used by fetch()?
GET
360
How do you specify the request method (GET, POST, etc.) when calling fetch?
manipulate init
361
When does React call a component's componentDidMount method?
componentDidMount() is invoked immediately after a component is mounted
362
Name three React.Component lifecycle methods.
componentWillUpdate, componentDidMount(), componentWillUnmount
363
How do you pass data to a child component?
pass in props
364
What must the return value of myFunction be if the following expression is possible? myFunction()();
function
365
``` What does this code do? const wrap = value => () => value; ```
parameter of first function
366
In JavaScript, when is a function's scope determined; when it is called or when it is defined?
defined
367
What allows JavaScript functions to "remember" values from their surroundings?
closure