HTML Flashcards

(317 cards)

1
Q

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

A

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

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

Within 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 which version of HTML you are 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

head, title, body, h1, p

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 HTML elements

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

® which is the registered trademark symbol

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 all the space and force neighboring elements to be moved to the next 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 allow elements to be right up against them and only take up as much space as they need

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

height is auto and width is until the end of the page

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

width and height are determined by as much content as there is

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 lists are meaningful lists that are numbered. Unordered lists are bulleted lists where the order doesn’t matter

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

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

Anchor tag or <a></a>

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

What is an absolute URL?

A

A URL that links to an external website from your own

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

What is a relative URL?

A

A shorthand URL that links to another page or part of your website internally

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

../directory/filename

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

child folder / filename

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

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

To collect information from users

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

textinput, checkbox, submit buttons, file upload, select options

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 elements.

A

submit, text and radio

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

Is an HTML form 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 defines a set of rows that are the headers for the table. tbody defines a set of rows that are the body of the table.
27
Give two examples of data that would lend itself well to being displayed in a table.
Gradebook for students and sports results for sports
28
What are the names of the individual pieces of a CSS rule?
css selector, declaration block, property and value
29
In CSS, how do you select elements by their class attribute?
using . before the name of the class Ex: .type
30
In CSS, how do you select elements by their type?
the name of the element Ex: h2
31
In CSS, how do you select an element by its id attribute?
using # Ex: #html
32
What CSS properties make up the box model?
Margin, padding and border
33
Which CSS property pushes boxes away from each other?
Margin
34
Which CSS property add space between a box's content and its border?
Padding
35
What is a pseudo-class?
Class that is applied by the browser that is only applied under certain conditions such as hover, focus, etc.
36
What are CSS pseudo-classes useful for?
Allows us to write less code for certain styling or makes it easier without having to add additional classes
37
What is the default flex-direction of a flex container
rows
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?
block level elements
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 change the position unless you affect the top, left, right, bottom values but other elements will still perceive it in the same position
44
How does setting position: absolute on an element affect document flow?
It removes it from the document flow
45
How does setting position: absolute on an element affect where it appears on the page?
Absolute looks for it's nearest non static element but it will be on a layer above the static elements
46
How do you constrain an absolutely positioned element to a containing block?
You can set the parent element to relative
47
What are the four box offset properties?
top, bottom, left and right
48
What is the purpose of variables?
When you need to store a value
49
How do you declare a variable?
using var "name"
50
How do you initialize (assign a value to) a variable?
Using the = operator and inputting a value with the variable name
51
What characters are allowed in variable names?
letters, numbers, underscore and $
52
What does it mean to say that variable names are "case sensitive"?
They must be typed exactly as they are shown
53
What is the purpose of a string?
To store letters and text
54
What is the purpose of a number?
To use numbers for calculations or counting
55
What is the purpose of a boolean?
It's a logical operator that is helpful to use when something should be run or not
56
What does the = operator mean in JavaScript?
assign to
57
How do you update the value of a variable?
using the assignment operator
58
What is the difference between null and undefined?
undefined means the value is unknown or there is no value yet while null is intentionally pointing to a non-existing object
59
Why is it a good habit to include "labels" when you log values to the browser console?
The console log can spit out multiple values at once so labels can help identify which values are for the correct variable
60
Give five examples of JavaScript primitives.
null, undefined, string, number, boolean
61
What data type is returned by an arithmetic operation?
number
62
What is string concatenation?
Adding two strings together to combine them using the '+' operand
63
What purpose(s) does the + plus operator serve in JavaScript?
to join two values together
64
What data type is returned by comparing two values (, ===, etc)?
boolean
65
What does the += "plus-equals" operator do?
adds the value on the right hand side to the left hand side of the operator and assigns that as the new value
66
What are objects used for?
to group together variables and functions that are related to each other
67
What are object properties?
they describe an object and are a collection of key value pairs.
68
Describe object literal notation.
an object is declared and the properties for the object are listed inside a curly brace
69
How do you remove a property from an object?
Using the delete function
70
What are the two ways to get or update the value of a property?
Using dot notation or bracket notation and assigning a new value
71
What are arrays used for?
for storing lists
72
Describe array literal notation.
Listing out the array values using square brackets and single quotes
73
How are arrays different from "plain" objects?
They have numbers that represent each value and are in sequential order
74
What number represents the first index of an array?
0
75
What is the length property of an array?
gives back the total length of the array which describes how many values are in the array
76
How do you calculate the last index of an array?
length of array - 1
77
What is a function in JavaScript?
A block of code or repeatable steps that is stored within one name
78
Describe the parts of a function definition.
function keyword, name of function, parameters, function block of code
79
Describe the parts of a function call.
function name followed by parenthesis with the arguments inside
80
When comparing them side-by-side, what are the differences between a function call and a function definition?
Function call doesn't have the block of code, only the name of the function with the arguments
81
What is the difference between a parameter and an argument?
parameter is within the function definition that may or may not have some code associated with it while the argument is what is passed into the function in place of the parameter
82
Why are function parameters useful?
parameters can give data to the functions but also provide data to get different results out of the function
83
What two effects does a return statement have on the behavior of a function?
ends the function and also returns a value
84
Why do we log things to the console?
Be able to debug and print code while we are working on the code
85
What is a method?
A function which is the property of an object
86
How is a method different from any other function?
A method is associated with an object while a function is not
87
How do you remove the last element from an array?
pop method
88
How do you round a number down to the nearest integer?
floor method of the math object
89
How do you generate a random number?
random method of the math object
90
How do you delete an element from an array?
splice method
91
How do you append an element to an array?
push method
92
How do you break a string up into an array?
split method
93
Do string methods change the original string? How would you check if you weren't sure?
No and if you're not you can use MDN
94
Is the return value of a function or method useful in every situation?
Not always
95
Give 6 examples of comparison operators.
>, =, <=
96
What is the purpose of an if statement?
Conditional loop
97
What is the purpose of an if statement?
only to do work if a condition is met or to make a decision
98
What are the three logical operators?
&&, ||, !=
99
Describe the syntax (structure) of an if statement.
if (condition) { code block }
100
How do you compare two different expressions in the same condition?
Using the logical AND or logical OR operators
101
What is the purpose of a loop?
To repeat a pattern
102
What is the purpose of a condition expression in a loop?
Allows the loop to stop
103
What does "iteration" mean in the context of loops?
Repeat the loop
104
When does the condition expression of a while loop get evaluated?
Before each iteration
105
When does the initialization expression of a for loop get evaluated?
Before the condition, it is the first thing that happens
106
When does the condition expression of a for loop get evaluated?
Before each loop iteration and after the initialization
107
When does the final expression of a for loop get evaluated?
At the end of each iteration
108
Besides a return statement, which exits its entire function block, which keyword exits a loop before its condition expression evaluates to false?
break
109
What does the ++ increment operator do?
Increments by one and assigns it to the variable
110
How do you iterate through the keys of an object?
Use the for in loop
111
What are the four components of "the Cascade".
Source Order, Specificity, Inheritance and !imporant
112
What does the term "source order" mean with respect to CSS?
Source order is, simply put, the order that your CSS rules are written in your stylesheet.
113
How is it possible for the styles of an element to be applied to its children as well without an additional CSS rule?
Because of inheritance
114
List the three selector types in order of increasing specificity.
Type, Class, ID
115
Why is using !important considered bad practice?
It makes debugging difficult because it breaks the normal cascading in the stylesheet
116
Why do we log things to the console?
To check to make sure it is working properly and debugging
117
What is a "model"?
a representation of something
118
Which "document" is being referred to in the phrase Document Object Model?
html document
119
What is the word "object" referring to in the phrase Document Object Model?
objects in the javascript language
120
What is a DOM Tree?
map of all the elements and nodes that represent the relationship between the elements. It's generated by the browser.
121
What does document.querySelector() take as its argument and what does it return?
css selectors and it returns the first matching element
122
What does document.querySelectorAll() take as its argument and what does it return?
css selectors and it returns all elements that match the selector
123
Why would a tag need to be placed at the bottom of the HTML content instead of at the top?
HTML loads top to bottom so if the script is loaded too early it won't be able to do anything since none of the html elements were loaded yet
124
What is the purpose of events and event handling?
to allow the browser to respond to user activity
125
What is a callback function?
a function that is called to repeat after already executing
126
What is the event.target? If you weren't sure, how would you check? Where could you get more information about it?
MDN
127
What method of element objects lets you set up a function to be called when a specific type of event occurs?
addEventListener
128
What is the purpose of events and event handling?
events allow the browser to respond to user activity and event handling also triggers scripts for javascript to allow the browser to respond to user activity
129
What do [] square brackets mean in function and method syntax documentation?
optional values
130
What is a callback function?
a function passed into another function as an argument
131
What is the event.target? If you weren't sure, how would you check? Where could you get more information about it?
The target property of the Event interface is a reference to the object onto which the event was dispatched. MDN
132
What object is passed into an event listener callback when the event fires?
The event object which contains all information about the event
133
What is the className property of element objects?
edits current class value
134
How do you update the CSS class attribute of an element using JavaScript?
use classname property with the object name for that element.
135
What is the textContent property of element objects?
text that's in the containing in the element and all of the children elements
136
How do you update the text within an element using JavaScript?
using textcontent attached to the object name equaling the new text content
137
Is the event parameter of an event listener callback always useful?
not always, js exercise didnt use it
138
Would this assignment be simpler or more complicated if we didn't use a variable to keep track of the number of clicks?
it would be a lot more difficult since you don't have a var to keep track of the clicks
139
Why is storing information about a program in variables better than only storing it in the DOM?
It's less work for the browser
140
What does the transform property do?
lets you rotate, scale, skew, or translate an element
141
Give four examples of CSS transform functions.
rotate, skew, translate, matrix
142
The transition property is shorthand for which four CSS properties?
transition-delay transition-duration transition-property transition-timing-function
143
What event is fired when a user places their cursor in a form control?
Focus
144
What event is fired when a user's cursor leaves a form control?
Blur
145
What event is fired as a user changes the value of a form control?
input
146
What event is fired when a user clicks the "submit" button within a ?
submit
147
What does the event.preventDefault() method do?
if the event does not get explicitly handled, its default action should not be taken as it normally would be.
148
What does submitting a form without event.preventDefault() do?
It clears the user inputs and refreshes the page
149
What property of a form element object contains all of the form's controls.
elements
150
What property of form a control object gets and sets its value?
value
151
What is one risk of writing a lot of code without checking to see if it works so far?
It's harder to debug
152
What is an advantage of having your console open when writing a JavaScript program?
You can check to see if it is working in real time as you write your code
153
Does the document.createElement() method insert a new element into the page?
no it just creates an element that still needs to be assigned a position
154
Name two ways to set the class attribute of a DOM element.
setAttribute or className
155
What do you pass as the arguments to the element.setAttribute() method?
attribute name and value
156
What steps do you need to take in order to insert a new element into the page?
create element, optionally add text content and then append it into the desired position
157
What are two advantages of defining a function to do create something (like the work of creating a DOM tree)?
You can automate the steps of doing work into one function and repeat the work as many times as needed
158
What are two advantages of defining a function to do create something (like the work of creating a DOM tree)?
You can automate the steps of doing work into one function and repeat the work as many times as needed, also let's you name the purpose of the code block
159
Give two examples of media features that you can query in an @media rule.
width and height
160
Which HTML meta tag is used in mobile-responsive web pages?
viewport meta tag
161
What is the event.target?
the element where the event originated from
162
Why is it possible to listen for events on one element that actually happen its descendent elements?
Because of event bubbling and event capturing
163
What DOM element property tells you what type of element it is?
event.target.tagName
164
What does the element.closest() method take as its argument and what does it return?
selector string and it returns the closest element with the selector
165
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?
Using event delegation by adding an event via the matching tagName
166
What is the affect of setting an element to display: none?
Hides the element
167
How can you retrieve the value of an element's attribute?
getAttribute
168
At what steps of the solution would it be helpful to log things to the console?
Every step
169
At what steps of the solution would it be helpful to log things to the console?
Every step
170
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?
A lot of if statements and have individual unique classes for each tab
171
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?
It will scale with the screen size rather than having a set value
172
What is a breakpoint in responsive Web design?
points where the website responds to the width of the device
173
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?
Due to Source Order
174
What are serialization and deserialization?
serialization is when you need to convert json data into bytes to transfer and deserialization is converting bytes into json data
175
What is JSON?
JSON(javascript object notation) is an open standard file format, and data interchange format, that uses human-readable text to store and transmit data objects
176
How do you deserialize a JSON string into a data structure using JavaScript?
parse
177
Why are serialization and deserialization useful?
useful for transferring data across a network or storing the data
178
How to you store data in localStorage?
setItem
179
How to you retrieve data from localStorage?
getItem
180
What data type can localStorage save in the browser?
string
181
When does the 'beforeunload' event fire on the window object?
When you refresh the page
182
What is a method?
a function that is attached to an object
183
How can you tell the difference between a method definition and a method call?
definition is a function definition inside an object whereas a method call is attached to an object with a parameter
184
Describe method definition syntax (structure).
variable keyword and the method is the property while the value is the function
185
What does API stand for?
Application program interface
186
How is a method different from any other function?
a method is attached to an object
187
What is the defining characteristic of Object-Oriented Programming?
objects can contain both data (as properties) and behavior (as methods).
188
What is this in JavaScript?
Implicit parameter of all javascript functions, references the object that it is inside otherwise it will reference the global window
189
What does it mean to say that this is an "implicit parameter"?
Never declared as a parameter but it is an argument that is available inside the function
190
When is the value of this determined in a function; call time or definition time?
when it's called
191
Given the above character object, what is the result of the following code snippet? Why? character.greet();
It's a me mario, because this is referring to the character variable
192
``` Given the above character object, what is the result of the following code snippet? Why? var hello = character.greet; hello(); ```
undefined
193
``` Given the above character object, what is the result of the following code snippet? Why? var hello = character.greet; hello(); ```
undefined because the method is being pulled out of the object, there is no reference to the object properties
194
How can you tell what the value of this will be for a particular function or method definition?
you can't determine the value until it is called
195
How can you tell what the value of this is for a particular function or method call?
it will be the object to the left of the dot otherwise it will be the global window
196
What kind of inheritance does the JavaScript programming language use?
JavaScript includes a specific kind of inheritance known as prototype-based (or prototypal) inheritance.
197
What is a prototype in JavaScript?
an object that contains properties and (predominantly) methods that can be used by other objects.
198
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?
due to prototypes
199
If an object does not have it's own property or method by a given key, where does JavaScript look for it?
on the prototype object
200
What does the new operator do?
create an instance of a user-defined object type that has a constructor function
201
What property of JavaScript functions can store shared behavior for instances created with new?
prototype property
202
What does the instanceof operator do?
checks to see if object is a prototype of the variable
203
What is a "callback" function?
A function definition being passed around as a value
204
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()
205
How can you set up a function to be called repeatedly without using a loop?
setInterval()
206
What is the default time delay if you omit the delay parameter from setTimeout() or setInterval()?
0
207
What do setTimeout() and setInterval() return?
they return the function value
208
What is a client?
Service requester
209
What is a server?
Provider of a resource or service
210
Is a body required for a valid HTTP request or response message?
No
211
what 3 things are on the start-line of an HTTP request message?
HTTP method (GET, POST, PUT), request target (absolute URL), and HTTP version (HTTP/1.1)
212
what 3 things are on the start-line of an HTTP respond message?
Protocol version (HTTP/1.1), status code (ex: 404) and status text (description of status code)
213
what are HTTP headers?
Additional information by the client or server which consist of name followed by colon followed by its value
214
What is AJAX?
programming practice building complex and dynamic webpages using XMLHttpRequest
215
What does the AJAX acronym stand for?
Asynchronous Javascript and XML
216
Which object is built into the browser for making HTTP requests in JavaScript?
XMLHttpRequest
217
What event is fired by XMLHttpRequest objects when they are finished loading the data from the server?
load
218
XMLHttpRequest has addEventListener() just like DOM lements. How is it possible that they both have this?
because of prototype objects
219
What is a code block? What are some examples of a code block?
series of code within a function or loop
220
What does block scope mean?
code that is only defined within a function and not in the global file
221
What is the scope of a variable declared with const or let?
block scoped for let and const is global
222
Why is it possible to .push() a new value into a const variable that points to an Array?
because the variable itself is not changing, the array is just being appended
223
How should you decide on which type of declaration to use?
If the variable is not going to change value then use const otherwise use let
224
What is the syntax for writing a template literal?
using ` ${variable} `
225
What is "string interpolation"?
Substitutions that allow you to embed variables and expressions in the string. The JavaScript engine will automatically replace these variables and expressions by their values.
226
What is destructuring, conceptually?
assigning parts of an object or array to individual variables
227
What is the syntax for Object destructuring?
``` const { title: frenchTitle, author: frenchAuthor, libraryID: bookID } = book2; ```
228
What is the syntax for Array destructuring?
const [book3, book4, book5] = library;
229
How can you tell the difference between destructuring and creating Object/Array literals?
array destructuring does not contain property names
230
What is the syntax for defining an arrow function?
more than one parameter, use parenthesis and use arrow and then enclose code block in curly braces
231
When an arrow function's body is left without curly braces, what changes in its functionality?
you don't need a return statement
232
How is the value of this determined within an arrow function?
determined by definition time
233
What is a CLI?
command-line interface
234
What is a GUI?
graphical user interface
235
``` Give at least one use case for each of the commands listed in this exercise. man cat ls pwd echo touch mkdir mv rm cp ```
``` man = looking up the meaning of a command cat = reading contents of file or combining contents of multiple files ls = seeing all the files in current directory pwd = seeing current working directory echo = creating text touch = creating empty file mkdir = creating new directory mv = moving file or renaming rm = removing file cp = copying file to another file ```
236
What are the three virtues of a great programmer?
1. Laziness: The quality that makes you go to great effort to reduce overall energy expenditure. It makes you write labor-saving programs that other people will find useful and document what you wrote so you don't have to answer so many questions about it. 2. Impatience: The anger you feel when the computer is being lazy. This makes you write programs that don't just react to your needs, but actually anticipate them. Or at least pretend to. 3. Hubris: The quality that makes you write (and maintain) programs that other people won't want to say bad things about.
237
What is Node.js?
Node.js is a program that allows JavaScript to be run outside of a web browser
238
What can Node.js be used for?
It is commonly used to build back ends for Web applications, command-line programs, or any kind of automation that developers wish to perform
239
What is a REPL?
read–eval–print loop, that takes single user inputs, executes them, and returns the result to the user;
240
When was Node.js created?
2009
241
What back end languages have you heard of?
Ruby, PHP, python, Java
242
What is a computer process?
a process is the instance of a computer program that is being executed by one or many threads. It contains the program code and its activity.
243
Roughly how many computer processes are running on your host operating system (Task Manager or Activity Monitor)?
157
244
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. This will be extremely important when learning about applications made of multiple components, such as clients, servers, and databases.
245
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.
246
How do you access the process object in a Node.js program?
it's included in the global scope so you can just type in process
247
What is the data type of process.argv in Node.js?
array
248
What is a JavaScript module?
a single .js file
249
What values are passed into a Node.js module's local scope?
__dirname, __filename, module, exports, require
250
Give two examples of truly global variables in a Node.js program.
global, URL
251
What is the purpose of module.exports in a Node.js module?
allows a function to be exported so other modules are able to accessed
252
What is the JavaScript Event Loop?
handles the execution of multiple chunks of your program over time, each time invoking the JS Engine and pushing items from the task queue to the stack
253
What is different between "blocking" and "non-blocking" with respect to how code is executed?
Blocking assignment executes "in series" because a blocking assignment blocks execution of the next statement until it completes. ... Non-blocking assignment executes in parallel because it describes assignments that all occur at the same time.
254
What is a directory?
a collection of files in one place
255
What is a relative file path?
file path within directory
256
What is an absolute file path?
file path external to directory
257
What module does Node.js include for manipulating the file system?
fs (file system) module
258
What method is available in the Node.js fs module for writing data to a file?
writeFile
259
Are file operations using the fs module synchronous or asynchronous?
asynchronous
260
What is on the first line of an HTTP request message?
HTTP method, request target URL and HTTP version
261
What is on the first line of an HTTP response message?
protocol, status code and status text
262
Is a body required for a valid HTTP message?
No
263
What is NPM?
npm is the world's largest software registry. Open source developers from every continent use npm to share and borrow packages, and many organizations use npm to manage private development as well. the website the Command Line Interface (CLI) the registry
264
What is a package?
holds various metadata relevant to the project. This file is used to give information to npm that allows it to identify the project as well as handle the project's dependencies. Has to have package.json
265
How can you create a package.json with npm?
npm init --yes
266
What is a dependency and how to you add one to a package?
using the install command and it is something the project depends on
267
What happens when you add a dependency to a package with npm?
it creates node modules and modifies the packages.json file
268
How do you add express to your package dependencies?
npm install express
269
What Express application method starts the server and binds it to a network PORT?
listen()
270
How do you mount a middleware with an Express application?
use method with a callback function
271
Which objects does an Express application pass to your middleware to manage the request/response lifecycle of the server?
request and response objects
272
What is the appropriate Content-Type header for HTTP messages that contain JSON in their bodies?
application/json
273
What is PostgreSQL and what are some alternative relational databases?
An open source relational database management system. MySQL (also free), SQL Server by Microsoft, and Oracle by Oracle Corporation.
274
What are some advantages of learning a relational database?
Relational databases are arguably the most widely used kind of database
275
What is one way to see if PostgreSQL is running?
sudo service postgresql status
276
What is a database schema?
A schema defines how the data in a relational database should be organized.
277
What is a row?
a single structured data item in a table
278
What are the three states a Promise can be in?
pending, fulfilled or rejected
279
How do you handle the fulfillment of a Promise?
using the 'then' method
280
How do you handle the rejection of a Promise?
using the 'then' method or 'catch'
281
What is Array.prototype.filter useful for?
For filtering out arrays
282
What is Array.prototype.map useful for?
Transforming elements in an array without having to loop
283
What is Array.prototype.reduce useful for?
combining elements of an array
284
What is "syntactic sugar"?
designed to make things easier to read or to express
285
What is the typeof an ES6 class?
function
286
Describe ES6 class syntax.
class keyword then function name followed by open curly brace then constructor method with parameters and underneath will be all method functions
287
What is "refactoring"?
restructuring existing code without changing its behavior
288
What is Webpack?
It's a tool that lets you bundle your JavaScript applications (supporting both ESM and CommonJS), and it can be extended to support many different assets such as images, fonts and stylesheets.
289
How do you add a devDependency to a package?
--save-dev
290
What is an NPM script?
scripts to automate tasks that are built into NPM
291
How do you execute Webpack with npm run?
npm run build
292
How are ES Modules different from CommonJS modules?
ES6 modules are pre-parsed in order to resolve further imports before code is executed. CommonJS modules load dependencies on demand while executing the code.
293
What kind of modules can Webpack support?
``` ECMAScript modules CommonJS modules AMD modules Assets WebAssembly modules ```
294
What is React?
A JavaScript library for building user interfaces
295
What is a React element?
A React Element is what gets returned from components. It's an object that virtually describes the DOM nodes that a component represents.
296
What is the purpose of state in React?
It is like our data model for our application, it keeps track of values that change over time
297
How to you pass an event handler to a React element?
pass a prop to a react element
298
What is JSX?
it is a syntax extension to JavaScript. We recommend using it with React to describe what the UI should look like. JSX may remind you of a template language, but it comes with the full power of JavaScript.
299
Why must the React object be imported when authoring JSX in a module?
JSX compiles into calls to React.createElement
300
How do you mount a component to the DOM?
Using ReactDOM.render and specifying the component as an argument and then specifying the location using document.getelementbyId
301
What is a React component?
Components let you split the UI into independent, reusable pieces, and think about each piece in isolation
302
How do you pass props to a component?
props.[propname]
303
What are props in React?
“Props” is a special keyword in React, which stands for properties and is being used for passing data from one component to another.
304
How do you write JavaScript expressions in JSX?
using {}
305
How do you create "class" component in React?
class [className] extends React.Component
306
How do you access props in a class component?
using this.props
307
What Array method is commonly used to create a list of React elements?
map
308
What is the best value to use as a "key" prop when rendering lists?
identifies a list item among its siblings.
309
What does express.static() return?
returns the middleware function
310
What is the local __dirname variable in a Node.js module?
gives absolute path of the current module
311
What does the join() method of Node's path module do?
concatenates strings into path name
312
What does fetch() return?
returns a promise response object
313
What is the default request method used by fetch()?
GET
314
What are controlled components?
one that takes its current value through props and notifies changes through callbacks like onChange
315
What are controlled components?
An input form element whose value is controlled by React where one that takes its current value through props and notifies changes through callbacks like onChange
316
Name three React.Component lifecycle methods.
render, constructor and componentDidMount()
317
How do you pass data to a child component?
by using props