HTML-CSS-JS Flashcards

(268 cards)

1
Q

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

A

in the element

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

Where do you put visible content about the HTML document?

A

in the element

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

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

A

in the element

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

What is the purpose of a declaration?

A

it tells the browser what type of document it is looking at, so it knows what to do with it

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>" - paragraph
"</p><h1>" heading biggest size
 "" main body
  "" the title, what you see on the tab
  "" the opening tag of an entire html doc
"<div>"</div></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

they provide additional 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

&lt - less than sign

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

take up all the width of its parent element

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

takes up as much space as their 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

block element takes up the full width available to it and the height is equal to its contents

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

the height and width is determined by the boundary of its element tags.

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 shows a list using numbers <ol>

Unordered shows a list using bullet points </ol><ul></ul>

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

a list 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> </a>
anchor element
attribute href with the value of an absolute/relative URL to —

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

What is an absolute URL?

A

Absolute URL is a link to another website

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

What is a relative URL?

A

relative URL is linking to another page within the same site

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

href=”../folder-file name”

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

href=”folder name/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

href=”../../file name”

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

href=”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

allows you to collect user input

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, radio buttons, checkboxes, drop-down boxes, submit buttons

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, checkbox, radio

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

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

A

inline element

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 row - table data - a cell header - headings of a table sits inside - the table body sits inside
26
What purpose do the thead and tbody elements serve?
They help distinguish between the main content of the table and first row
27
Give two examples of data that would lend itself well to being displayed in a table
schedules, sports results, fiances, data
28
What are the names of the individual pieces of a CSS rule?
selector, declaration {property:value;}
29
In CSS, how do you select elements by their class attribute?
.name of class
30
In CSS, how do you select elements by their type?
element name
31
In CSS, how do you select an element by its id attribute?
#Id name
32
Name three different types of values you can use to specify colors in CSS.
color name - from 147 selections hex code rgb value
33
What CSS properties make up the box model?
margin, padding, border
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?
a keyword added to a selector that specifies a special state of the selected element.
37
What are CSS pseudo-classes useful for?
They're useful for helping the user interact with the page. To allow the user some visual representation of what they're doing or that something is interact-able
38
Name at least two units of type size in CSS.
px | 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?
row
41
What is the default flex-wrap of a flex container?
nowrap - all flex items will be on one line
42
Why do two div elements "vertically stack" on one another by default?
because they're block-level
43
What is the default flex-direction of an element with display: flex?
row - left to right
44
How does setting position: absolute on an element affect document flow?
it takes the element out of normal flow, and other elements can take its place. Other elements will move into its space.
45
How does setting position: absolute on an element affect where it appears on the page?
It looks for a non-static positioned parent to align to.
46
How do you constrain an absolutely positioned element to a containing block?
set a non-static position to the parent you want it to align to.
47
What are the four box offset properties?
top, bottom, right, left
48
What is the purpose of variables?
to remember specific values, to store or manipulate later
49
How do you declare a variable?
in the js file | var variableName;
50
How do you initialize (assign a value to) a variable?
after you declare | variableName = X
51
What characters are allowed in variable names?
letters, $, or _ to start numbers and letters, _ inside no - or . in a name
52
What does it mean to say that variable names are "case sensitive"?
the name of the variable needs to match its name exactly, so runFaster is not the same as runfaster.
53
What is the purpose of a string?
to have text content as a value of a variable. Literal representation of characters.
54
What is the purpose of a number?
math, size of a screen, moving the position of something on screen. Setting time. Hold and represent numerical data.
55
What is the purpose of a boolean?
to hold either true or false.
56
What does the = operator mean in JavaScript?
assignment operator, assign a value to something
57
How do you update the value of a variable?
by assigning it a new value
58
What is the difference between null and undefined?
null is an intentionally nonexistent or invalid object. | undefined is something that has a variable that is only declared and not assigned a value.
59
Why is it a good habit to include "labels" when you log values to the browser console?
labels help to distinguish what is being logged to the console if you have multiple console logs.
60
Give five examples of JavaScript primitives.
null, undefined, boolean, string, number
61
What data type is returned by an arithmetic operation?
number
62
What is string concatenation?
combining two or more strings to make a longer string.
63
What purpose(s) does the + plus operator serve in JavaScript?
to add two things together, either by concatenation or numerically
64
What data type is returned by comparing two values (, ===, etc)?
boolean, true or false
65
What does the += "plus-equals" operator do?
it adds the value of the right operand to a variable and assigns the results to the variable.
66
What are objects used for?
grouping together sets of variables and functions to create a model of something you would recognize in the real world.
67
What are object properties?
properties are variables
68
Describe object literal notation.
it is creating an object by first typing var objectName = { propertyName: propertyValue, };
69
How do you remove a property from an object?
using the delete operator | delete objectName.propertyName
70
What are the two ways to get or update the value of a property?
dot notation objectName.propertyName = propertyValue; bracket notation objectName['propertyName'] = propertyValue;
71
What are arrays used for?
lists or sets of values that are related to each other
72
Describe array literal notation.
var arrayName = ['arrayValue1','arrayValue2']
73
How are arrays different from "plain" objects?
are numerically indexed
74
What number represents the first index of an array?
0
75
What is the length property of an array?
arrayName.length - it tells you the amount of values in the array.
76
How do you calculate the last index of an array?
(arrayName.length - 1)
77
What is a function in JavaScript?
A small program that can be called and reused for a number of different situations.
78
Describe the parts of a function definition.
``` function keyword optional name parameters code block optional return statement end of the function code block ```
79
Describe the parts of a function call.
typing the function keyword and its parameters.
80
When comparing them side-by-side, what are the differences between a function call and a function definition?
A call uses a function already defined, while a definition is creating a function to be called
81
What is the difference between a parameter and an argument?
parameter is a placeholder for arguments
82
Why are function parameters useful?
allow us to give data to functions
83
What two effects does a return statement have on the behavior of a function?
1. Causes the function to produce a value we can use | 2. Prevents any more code in the functions code block from being run.
84
Why do we log things to the console?
To test our JS
85
What is a method?
a Function that is a property of an object.
86
How is a method different from any other function?
methods are called to/from an object
87
How do you remove the last element from an array?
pop() method, removes the last element from an array
88
How do you round a number down to the nearest integer?
Math.floor() method
89
How do you generate a random number?
Math.random() creates a # 1 or 0, to make a larger random number it must be multiplied by another number.
90
How do you delete an element from an array?
splice(index starting #, how many elements to remove)
91
How do you append an element to an array?
push() method adds one or more elements to the end of an array.
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?
String methods do not change the original string. Strings are immutable, so any changes to strings are actually new strings. log the console object
94
Roughly how many string methods are there according to the MDN Web docs?
50
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?
38
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.
``` > less then > greater then >= greater then or equals <= less then or equals === strictly equals != is not equal to == equals !== strictly not equal ```
99
What data type do comparison expressions evaluate to?
boolean
100
What is the purpose of an if statement?
What is the purpose of an if statement? | to determine if the condition is true or false
101
Is else required in order to use an if statement?
no
102
Describe the syntax (structure) of an if statement.
if keyword condition curly brace - code to execute if value is true - closing curly brace
103
What are the three logical operators?
|| one is true - logical or && both are true - logical and ! - logical not - inverts the boolean value
104
How do you compare two different expressions in the same condition?
put them in parenthesis and use a logical operator
105
What is the purpose of a loop?
Loops check a condition, until the condition returns false. | Loops allow us to create a code block and repeat it as fast as the computer can do it.
106
What is the purpose of a condition expression in a loop?
It tells the loop when to stop running
107
What does "iteration" mean in the context of loops?
one full pass through a loop. The code block running one time.
108
When does the condition expression of a while loop get evaluated?
before each iteration of the loop
109
When does the initialization expression of a for loop get evaluated?
before the loop runs for the first time
110
When does the condition expression of a for loop get evaluated?
before each loop iteration
111
When does the final expression of a for loop get evaluated?
at the end of each loop 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?
increases something by 1
114
How do you iterate through the keys of an object?
for in loop
115
What are the four components of "the Cascade".
Source Order inheritance Specificity !Important
116
What does the term "source order" mean with respect to CSS?
It means how the CSS rule sets are listed, from top to bottom, the last rule having the priority
117
How is it possible for the styles of an element to be applied to its children as well without an additional CSS rule?
CSS inheritance - Fonts and Colors CSS rule sets for certain properties are automatically transferred to the children elements. using inherit keyword after the the property propertyName: inherit;
118
List the three selector types in order of increasing specificity.
Type(element tag) Class ID
119
Why is using !important considered bad practice?
because it can make debugging more difficult
120
What is a "model"?
a representation of something
121
Which "document" is being referred to in the phrase Document Object Model?
a representation of the html
122
What is the word "object" referring to in the phrase Document Object Model?
html, and the elements within the html
123
What is a DOM Tree?
a tree showing the relationship between the elements making up the html
124
Give two examples of document methods that retrieve a single element from the DOM.
.querySelector | .getElementById
125
Give one example of a document method that retrieves multiple elements from the DOM at once.
.querySelectorAll
126
Why might you want to assign the return value of a DOM query to a variable?
because you dont want to query the document more than necessary
127
What console method allows you to inspect the properties of a DOM element object?
console.dir
128
Why would a tag need to be placed at the bottom of the HTML content instead of at the top?
because the html runs from top to bottom
129
What does document.querySelector() take as its argument and what does it return?
a valid css selector, return the first instance it locates
130
What does document.querySelectorAll() take as its argument and what does it return?
a valid css selector, a node list of those items that apply
131
Why do we log things to the console?
to see what the code is doing and to confirm the data
132
What is the purpose of events and event handling?
to do something when the user does something specific | When something happens, we have something else happen in return.
133
What do [] square brackets mean in function and method syntax documentation?
optional arguments/parameters
134
What method of element objects lets you set up a function to be called when a specific type of event occurs?
addEventListenr()
135
What is a callback function?
A function that we do not call directly. The function called into the addEventListener.
136
What object is passed into an event listener callback when the event fires?
the event object
137
What is the event.target? If you weren't sure, how would you check? Where could you get more information about it?
event.target is the element where the event takes place or is the origin of the event. MDN
138
What is the difference between these two snippets of code? element. addEventListener('click', handleClick) element. addEventListener('click', handleClick())
element. addEventListener('click', handleClick) - indicates that the function should run when the event happens. element. addEventListener('click', handleClick()) - indicates that the function should run when the page loads.
139
What is the className property of element objects?
it can assign a class name to an element
140
How do you update the CSS class attribute of an element using JavaScript?
.className = "new class name";
141
What is the textContent property of element objects?
shows the text content in that element
142
How do you update the text within an element using JavaScript?
.textContent = "new text content";
143
Is the event parameter of an event listener callback always useful?
No
144
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
145
Why is storing information about a program in variables better than only storing it in the DOM?
calling the DOM over and over can be taxing on the browser. Better to keep it controlled in javascript
146
What does the transform property do?
it can rotate, scale, etc an image
147
Give four examples of CSS transform functions.
rotate translateY - move up and down on the Y axis scale matrix
148
The transition property is shorthand for which four CSS properties?
transition-delay: the time before starting a transition transition-duration: the time it takes to complete the transition transition-property: which property to change transition-timing-function: lets you vary the speed of the transition over its duration
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?
stops any default behavior of an element. | for forms - prevents the page from reloading and sending the submitted information out
154
What does submitting a form without event.preventDefault() do?
It adds the form's values to the URL
155
What property of a form element object contains all of the form's controls.
.elements
156
What property of a form control object gets and sets its value?
.value
157
What is one risk of writing a lot of code without checking to see if it works so far?
It can be harder to discover where your error is, if there is one.
158
What is an advantage of having your console open when writing a JavaScript program?
You can test and see
159
Does the document.createElement() method insert a new element into the page?
no, it just creates the element.
160
How do you add an element as a child to another element?
parentEleName.appendChild(child name)
161
What do you pass as the arguments to the element.setAttribute() method?
attribute name and its value | element attributes, like src for images or href for links.
162
What steps do you need to take in order to insert a new element into the page?
``` var newPElement = document.createElement('p'); return the element ```
163
What is the textContent property of an element object for?
its used to get or add textContent to an element.
164
Name two ways to set the class attribute of a DOM element.
elementName.className = 'class-name'; | elementName.setAttribute('class', 'class-name')
165
What are two advantages of defining a function to create something (like the work of creating a DOM tree)?
It can be used over and over again. | It can take in sets of data like an array and create multiple items with different information.
166
Give two examples of media features that you can query in an @media rule.
height | width
167
Which HTML meta tag is used in mobile-responsive web pages?
meta name="viewport"
168
What is the event.target?
the element or area where the event took place
169
Why is it possible to listen for events on one element that actually happen its descendant elements?
because the descendant is inside the parent, so in interacting with the descendant you are also interacting with the parent. Event bubbling
170
What DOM element property tells you what type of element it is?
event.target.tagName
171
What does the element.closest() method take as its argument and what does it return?
``` class name or element name the closest parent element that matches that class or element ```
172
How can you remove an element from the DOM?
nameOfElement.remove();
173
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?
event delegation, by adding an eventlistener to the parent element.
174
What is the event.target?
the element where the event took place. the point of interaction
175
What is the affect of setting an element to display: none?
It hides the element from view, while not taking up any space on the page. visibility none, hides the element from view, but still maintains its space.
176
What does the element.matches() method take as an argument and what does it return?
an element tagName or classname
177
How can you retrieve the value of an element's attribute?
eleName.getattribute(attName)
178
At what steps of the solution would it be helpful to log things to the console?
anytime you change something or add something new
179
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?
manually query each tab and event
180
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?
if statements running through each individual view to check if it matches.
181
What is a breakpoint in responsive Web design?
the point at which the web page changes based on meeting specific cretiriea
182
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?
percentage will always take up the same amount of space on each and every screen regardless of pixel count. columns and images - % padding and margin - fixed amounts, like px
183
If you introduce CSS rules for a smaller min-width after the styles for a larger min-width in your style sheet, the CSS rules for the smaller min-width will "win". Why is that?
because code is read from top to bottom, so the furthermost most rule will take precedent
184
What is JSON?
Text based data format that uses JS object syntax.
185
What are serialization and de-serialization?
Serialization is converting a native object into a string(stream of bytes). de-serialization is converting a string(stream of bytes) to a native object.
186
Why are serialization and de-serialization useful?
Its useful for transferring data between computer systems
187
How do you serialize a data structure into a JSON string using JavaScript?
JSON.stringify()
188
How do you de-serialize a JSON string into a data structure using JavaScript?
JSON.parse()
189
How to you store data in localStorage?
localStorage.setItem(key name, value )
190
How to you retrieve data from localStorage?
localStorage.getItem(key name, value or Var)
191
What data type can localStorage save in the browser?
JSON string
192
When does the 'beforeunload' event fire on the window object?
right before the page will unload
193
What is a method?
A function that is a property of an object.
194
How can you tell the difference between a method definition and a method call?
method has parameters and the code block for what to do with the parameters. Calling the method is using it with the proper arguments to get the desired outcome.
195
Describe method definition syntax (structure).
var object name = { method name: function(keyword) (parameters) { code block for what the method will do with the parameters. }
196
Describe method call syntax (structure).
objectName.methodName(arguments)
197
How is a method different from any other function?
a method is tied to a specific object.
198
What is the defining characteristic of Object-Oriented Programming?
objects can contain both data(as properties) and behavior(as methods).
199
What are the four "principles" of Object-Oriented Programming?
Abstraction Encapsulation Inheritance Polymorphism
200
What is "abstraction"?
Being able to work with complex things in simple ways.
201
What does API stand for?
Application programming interface
202
What is the purpose of an API?
simplifying programming by abstracting the underlying implementation and only exposing objects or actions the developer needs. a set of services available to a programmer for performing certain tasks. to share information/functionality
203
What is this in JavaScript?
the implicit parameter that refers to the object at call time of all JS functions.
204
What does it mean to say that this is an "implicit parameter"?
It is always there, even though it is never explicitly defined.
205
When is the value of this determined in a function; call time or definition time?
call time
206
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
207
Given the above character object, what is the result of the following code snippet? Why? character.greet();
It's-a-me, Mario!
208
``` 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 this here is referring to the window object and the window does not have a first name property.
209
How can you tell what the value of this will be for a particular function or method definition?
if the function/method will be called with an object, like object.method, this will be have the value of the object. So the item left of the "." in the call.
210
How can you tell what the value of this is for a particular function or method call?
if the function/method will be called with an object, like object.method, this will be have the value of the object. So the item left of the "." in the call. if its not called with an object, this will be the global window object.
211
What kind of inheritance does the JavaScript programming language use?
prototype-based or prototypal
212
What is a prototype in JavaScript?
A generalized object that can be cloned and extended to represent properties and functionality of the specific object.
213
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?
strings, arrays, and numbers all have prototypes that have specific functionality built into them.
214
If an object does not have it's own property or method by a given key, where does JavaScript look for it?
the prototype chain
215
What does the new operator do?
creates a new object type based on either a previously user-defined object type or one of the built in object-types that has a constructor function. Creates a blank, plain JavaScript object. Adds a property to the new object (__proto__) that links to the constructor function's prototype object. Binds the newly created object instance as the this context (i.e. all references to this in the constructor function now refer to the object created in the first step). Returns this if the function doesn't return an object.
216
What property of JavaScript functions can store shared behavior for instances created with new?
function.prototype
217
What does the instanceof operator do?
checks to see if the prototype property of a constructor appears anywhere in the prototype chain of an object.
218
What is a "callback" function?
A function passed into another function as an argument, which is then processed inside the outer function to complete the action.
219
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()
220
How can you set up a function to be called repeatedly without using a loop?
setInterval()
221
What is the default time delay if you omit the delay parameter from setTimeout() or setInterval()?
0, or the next event cycle
222
What do setTimeout() and setInterval() return?
timeoutID
223
What is a client?
service requesters (or personal computer devices, phones, laptops, etc.)
224
What is a server?
Providers of a resource or service
225
Which HTTP method does a browser issue to a web server when you visit a URL?
GET
226
What three things are on the start-line of an HTTP request message?
an HTTP method: GET PUT POST or HEAD or OPTIONS - describe the action to be performed. The request target, usually a URL, absolute path The HTTP version - defines the structure of the remaining message, lets you know the expected version to use for the response
227
What three things are on the start-line of an HTTP response message?
1 The protocol version 2 A status code - indicating success or failure 3 A status text - a brief, purely informational, text description of the status code, to help human understanding of the HTTP message.
228
What are HTTP headers?
``` They let the client and the server pass additional information with an HTTP request or response. It consists of its case-insensitive name followed by a colon: then by its value. General header Request Header Response Header Representation header ```
229
Where would you go if you wanted to learn more about a specific HTTP Header?
MDN HTTP Headers
230
Is a body required for a valid HTTP request or response message?
No, not all requests or responses have them.
231
What is AJAX?
A technique for loading data into part of a page without having to refresh the entire page. Allows you to make asynchronous requests.
232
What does the AJAX acronym stand for?
Asynchronous JavaScript And XML
233
Which object is built into the browser for making HTTP requests in JavaScript?
XMLHttpRequest
234
What event is fired by XMLHttpRequest objects when they are finished loading the data from the server?
load event
235
Bonus Question: An XMLHttpRequest object has an addEventListener() method just like DOM elements. How is it possible that they both share this functionality?
Using prototype
236
What is a code block? What are some examples of a code block?
the space between {}. if, else, for, do A function that has a code block.
237
What does block scope mean?
Only exists in the area within the code block
238
What is the scope of a variable declared with const or let?
block scoped var is function scoped
239
What is the difference between let and const?
const is immutable (can't be changed) | let is mutable
240
Why is it possible to .push() a new value into a const variable that points to an Array?
The properties are what are unchangeable, but the values can be changed.
241
How should you decide on which type of declaration to use?
If you will be reassigning the variable (such as a for loop) you will want to use let. If the variable will stay the same, use const. Default to const unless you realize it will change and then use let.
242
What is destructuring, conceptually?
assigning object/array properties to individual variables
243
What is the syntax for Object destructuring?
const/let { property1: variable1, etc } = objectName;
244
What is the syntax for Array destructuring?
const/let [index[x], etc] = arrayName;
245
How can you tell the difference between destructuring and creating Object/Array literals?
they have reversed syntax. Creation starts with the variable name. Destructuring ends with variable name.
246
What is the syntax for writing a template literal?
`(backtick) textContent ${varName}`;
247
What is "string interpolation"?
String concatentation using variables or expressions in a way to make the code more readable.
248
What is the syntax for defining an arrow function?
const/let funName = (parameter) => {code block}
249
When an arrow function's body is left without curly braces, what changes in its functionality?
returns expression- implicit return, auto return
250
How is the value of this determined within an arrow function?
Whatever this is where its defined, the arrow function will be that this. Captures the this value of the enclosing context, instead of creating its own this context.
251
What is a CLI?
Command line interface
252
What is a GUI?
Graphical user interface
253
Give at least one use case for each of the commands listed in this exercise.
man - look up command information cat - combine the contents of files into one file, print the file info to the cmd line ls - listing out what is in a folder pwd - tells you exactly where you're at. see the contents of your current folder echo - print something to the cmd window touch - create files mkdir - create directories and folders in folders mv - rename or move a folder or file somewhere else rm - remove files or folders cp - copy files or folders
254
What is Node.js?
cmd line program that allows for JavaScript to be run outside of a browser
255
What can Node.js be used for?
to build back ends for web apps, cmd line programs, or automation.
256
What is a REPL?
Read-eval-print loop | A programming environment that takes single user inputs and executes them
257
When was Node.js created?
May 27th, 2009
258
What back end languages have you heard of?
Ruby, Java, Python, PHP, C#, JavaScript
259
What is a computer process?
An instance of a computer program that is being executed. The program passes an input to the computer and the computer returns an output.
260
Why should a full stack Web developer know that computer processes exist?
To understand how your apps and code actually work with the computer. Good to know and understand the load and resources that being used at once.
261
What is the process object in a Node.js program?
a global object that provides information about, and control over, the current running Node.js process.
262
How do you access the process object in a Node.js program?
process
263
What is the data type of process.argv in Node.js?
An array
264
What is a JavaScript module?
A single .js file
265
What values are passed into a Node.js module's local scope?
``` __dirname __filename require exports module ```
266
Give two examples of truly global variables in a Node.js program.
process console require
267
What is the purpose of module.exports in a Node.js module?
to allow the use of a function or item in other modules
268
How do you import functionality into a Node.js module from another Node.js module?
in module you want to export from you use module.export = nameOfWhatYoureExporting in module you are wanting to import to you use const nameOfWhatYourExporting = require('filePath')