Javascript Flashcards

1
Q

What is the purpose of variables?

A

to store data for the future.

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

How do you declare a variable?

A

utilizing the var keyword to declare it.

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

How do you initialize (assign a value to) a variable?

A

You assign the variable name (identifier) to a value using a single = sign.

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

What characters are allowed in variable names?

A

letters, underscore, start with $ or underscore camelCased capitalized letters but numbers cant be in the front.

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

What does it mean to say that variable names are “case sensitive”?

A

that the same variable name but with different casing have different variable names.

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

What is the purpose of a string?

A

how to hold a sequence of data characters of characters of numbers letters and other characters

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

What is the purpose of a number?

A

to store number mainly for math

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

What is the purpose of a boolean?

A

to compare expressions as true or false.

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

What does the = operator mean in JavaScript?

A

assignment operator.

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

How do you update the value of a variable?

A

you set the variable name without the keyword to another variable value

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

What is the difference between null and undefined?

A

null is the intentional absence of value where it is an object. it can be assigned but not output by java. but undefined does not have a value assigned to a variable. 1) null get data later or it was never going to be added and you will know. Java outputs undefined so developers should not.

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

Why is it a good habit to include “labels” when you log values to the browser console?

A

logging the value without the label makes it unknown what it is being used and where it comes from.

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

Give five examples of JavaScript primitives.

A

str, num, undefined, boolean, null

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

What data type is returned by an arithmetic operation?

A

numbers

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

What is string concatenation?

A

when you combine strings utilizing , or + as any other data type becomes a string

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

What purpose(s) does the + plus operator serve in JavaScript?

A

Addition or concatenation

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

What data type is returned by comparing two values (<, >, ===, etc)?

A

boolean

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

What does the += “plus-equals” operator do?

A

it sets the value of the left side as it self plus what is on the right side

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

What are objects used for?

A

objects group together different variables datatypes can group multiple properties in association of the same object as well as being able have multiple similar object with differing properties be better organized.

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

What are object properties?

A

piece of data stored in object. easiest method to notate objects with curly brackets being assigned to a variable. with key vales.

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

Describe object literal notation.

A

defining the object and assigning to a curly brackets with a property key name : value

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

How do you remove a property from an object?

A

delete object.property

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

What are the two ways to get or update the value of a property?

A

through appending or using the = operator to the property and giving a value.

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

Give 6 examples of comparison operators.

A

> =
<=
<
===
!=

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

What data type do comparison expressions evaluate to?

A

boolean

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

What is the purpose of an if statement?

A

to compare in a conditional.

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

Is else required in order to use an if statement?

A

no

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

Describe the syntax (structure) of an if statement.

A

if condition {conditional block}

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

What are the three logical operators?

A

&& and
|| or
! not

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

How do you compare two different expressions in the same condition?

A

using logical operators

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

Why do we log things to the console?

A

for debugging or to better understand how a process works.

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

What is a method?

A

it is a function within an object

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

How is a method different from any other function?

A

its is held within an object

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

How do you remove the last element from an array?

A

array.pop

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

How do you round a number down to the nearest integer?

A

Math.floor

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

How do you generate a random number?

A

math.random float number between 0 and 1 representing a percentage

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

How do you delete an element from an array?

A

array.splice(index, how many)

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

How do you append an element to an array?

A

array.push

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

How do you break a string up into an array?

A

array.split(what it splits by) delimiter

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

Do string methods change the original string? How would you check if you weren’t sure?

A

no. console.log

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

Is the return value of a function or method useful in every situation?

A

no they have return values but you wont always use it

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

What three-letter acronym should you always include in your Google search about a JavaScript method or CSS property?

A

mdn

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

What is the purpose of a loop?

A

a way to run a code block until a specific condition is met

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

What is the purpose of a condition expression in a loop?

A

To top the loop from continue running

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

What does “iteration” mean in the context of loops?

A

how many times it will be running

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

When does the condition expression of a for loop get evaluated?

A

after the initialization

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

When does the final expression of a for loop get evaluated?

A

After each iteration

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

When does the condition expression of a while loop get evaluated?

A

before running the while loop

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

When does the initialization expression of a for loop get evaluated?

A

the beginning of the loop

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

Besides a return statement, which exits its entire function block, which keyword exits a loop before its condition expression evaluates to false?

A

Break

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

What does the ++ increment operator do?

A

increases value by 1 by default.

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

How do you iterate through the keys of an object?

A

for (keys in object) {
}

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

What event is fired when a user places their cursor in a form control?

A

focus

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

What event is fired when a user’s cursor leaves a form control?

A

blur

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

What event is fired as a user changes the value of a form control?

A

input

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

What event is fired when a user clicks the “submit” button within a <form>?

A

‘submit’ which is fired on the form and not the button. Never have the click event listener on a button

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

What does the event.preventDefault() method do?

A

preventing the default behavior. for check box it will not show a check. not common you want to rid the default

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

What does submitting a form without event.preventDefault() do?

A

if you dont call it, page reloads and refreshes. the data is on the url but irrelevant to the point. based on initial behavior of form behaviors and action attributes. default behavior would submit to same page.

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

What property of a form element object contains all of the form’s controls.

A

form.elements has certain properties. numbered properties, named properties in multiple forms. same thing is saved multiple times. email too message too. two out of three are saafety cases. dom is trying to pass it. have property based off of id attribute. user-email will show minus not the whole thing. using .email takes the name attribute. is relevant to form submissions. use a name attribute in every input using dot notation.

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

What property of a form control object gets and sets its value?

A

any form control containing the value property is get and set by VALUE

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

What is one risk of writing a lot of code without checking to see if it works so far?

A

if it doesn’t work, you wont know whats working and not working

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

What is an advantage of having your console open when writing a JavaScript program?

A

see if there are any errors.

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

Does the document.createElement() method insert a new element into the page?

A

no

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

How do you add an element as a child to another element?

A

parent.appendchild(child)

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

What do you pass as the arguments to the element.setAttribute() method?

A

assigned value to attribute

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

What steps do you need to take in order to insert a new element into the page?

A

create element then add textcontent if required then parent.appendchild(child)
make element, configure with class application or event listener, query for parent element, and then pass argument with appendchild.

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

What is the textContent property of an element object for?

A

assign value to textcontent

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

Name two ways to set the class attribute of a DOM element.

A

classname or set attribute or even set list.

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

What are two advantages of defining a function to do create something (like the work of creating a DOM tree)?

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

What is the event.target?

A

it references the object to which an event happened

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

Why is it possible to listen for events on one element that actually happen its descendent elements?

A

bubbling allows its parents know which of its descendants are being listened to.

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

What DOM element property tells you what type of element it is?

A

event.target.tagName

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

What does the element.closest() method take as its argument and what does it return?

A

the closest item matching the argument string for css selector returning the nearest parent element with the css selector ancestor or null

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

How can you remove an element from the DOM?

A

element.remove()

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

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?

A

event delegation by putting the event listener on the ancestor

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

What is the affect of setting an element to display: none?

A

makes the element not visible and not take any space.

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

What does the element.matches() method take as an argument and what does it return?

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

How can you retrieve the value of an element’s attribute?

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

At what steps of the solution would it be helpful to log things to the console?

A

every step

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

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?

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

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

What is JSON?

A

JSON is a text-based data format

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

What are serialization and deserialization?

A

Serialization is when code is being transcoded to bits and stored data whereas deserialization is taking the bits and stored data into real code

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

Why are serialization and deserialization useful?

A

To transmit information through the internet.

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

How do you serialize a data structure into a JSON string using JavaScript?

A

JSON.stringify(file you want serialized)

86
Q

How do you deserialize a JSON string into a data structure using JavaScript?

A

JSON.parse(string you want deserialized)

87
Q

What are arrays used for?

A

To store a list of values

88
Q

Describe array literal notation.

A

set a variable = to square brackets [] and input items

89
Q

How are arrays different from “plain” objects?

A

Arrays use index values instead of keys like objects

90
Q

What number represents the first index of an array?

A

0

91
Q

What is the length property of an array?

A

it tells the length of the array.

92
Q

How do you calculate the last index of an array?

A

array at index [array.length]

93
Q

What is a function in JavaScript?

A

a set of statements that performs a task

94
Q

Describe the parts of a function definition.

A

it has the keyword function, an optional name, parameters in parenthesis curly brackets executing a statement and an optional return statement with a closing curly bracket for the function code block.

95
Q

Describe the parts of a function call.

A

using the defined name and simply passing an argument inside parenthesis.

96
Q

When comparing them side-by-side, what are the differences between a function call and a function definition?

A

‘function calls’ call the defined function. it utilizes it.

97
Q

What is the difference between a parameter and an argument?

A

parameters are defined within the definition while arguments utilize the function with its values as the parameters used in functions

98
Q

Why are function parameters useful?

A

They are utilized as variables within the function when the function is called.

99
Q

What two effects does a return statement have on the behavior of a function?

A

it returns the statement out of the function and ends the function.

100
Q

What is a “model”?

A

How html page can access and contents update

101
Q

Which “document” is being referred to in the phrase Document Object Model?

A

the DOM document node

102
Q

What is the word “object” referring to in the phrase Document Object Model?

A

the different parts of the page loaded in the browser window

103
Q

What is a DOM Tree?

A

The list of elements attribute and text in the html from parent to child

104
Q

Give two examples of document methods that retrieve a single element from the DOM.

A

getElementby or queryselector

105
Q

Give one example of a document method that retrieves multiple elements from the DOM at once.

A

queryselectorAll

106
Q

Why might you want to assign the return value of a DOM query to a variable?

A

to access and add methods to the queried return

107
Q

What console method allows you to inspect the properties of a DOM element object?

A

console.dir

108
Q

Why would a

 tag need to be placed at the bottom of the HTML content instead of at the top?
A

because of the dom tree not existing prior to whatever scripts would be queried

109
Q

What does document.querySelector() take as its argument and what does it return?

A

a selector and returns what the element the selected argument holds

110
Q

What does document.querySelectorAll() take as its argument and what does it return?

A

It takes a selector and returns a nodelist of all the selected elements are.

111
Q

What is the purpose of events and event handling?

A

To have user interaction from the user and have a function run when the interaction happens.

112
Q

Are all possible parameters required to use a JavaScript method or function?

A

function

113
Q

What method of element objects lets you set up a function to be called when a specific type of event occurs?

A

addEventListener

114
Q

What is a callback function?

A

function called when an event is fired.

115
Q

What object is passed into an event listener callback when the event fires?

A

a callback function

116
Q

What is the event.target? If you weren’t sure, how would you check? Where could you get more information about it?

A

reference to the object onto which the event was dispatched. in the console log.

117
Q

What is the difference between these two snippets of code?

A

one will pass it no matter what where as one will wait til the event listener is passed

118
Q

What is the className property of element objects?

A

gets and sets the value of the class attribute of the specified element.

119
Q

How do you update the CSS class attribute of an element using JavaScript?

A

by query selecting the object and setting className = ‘a class name’

120
Q

What is the textContent property of element objects?

A

the Node interface represents the text content of the node and its descendants.

121
Q

How do you update the text within an element using JavaScript?

A

by query selecting the object and setting textContent = ‘a class name’

122
Q

Is the event parameter of an event listener callback always useful?

A

No. It can be called but can just run the function.

123
Q

Would this assignment be simpler or more complicated if we didn’t use a variable to keep track of the number of clicks?

A

harder as we would need to reference the dom for the current text content of which number is being used on how many clicks were done

124
Q

Why is storing information about a program in variables better than only storing it in the DOM?

A

It is easier to reference within the variables than constantly refer to the dom

125
Q

What event is fired when a user places their cursor in a form control?

A
126
Q

What event is fired when a user’s cursor leaves a form control?

A
127
Q

What event is fired as a user changes the value of a form control?

A
128
Q

What event is fired when a user clicks the “submit” button within a <form>?

A
129
Q

What does the event.preventDefault() method do?

A
130
Q

What does submitting a form without event.preventDefault() do?

A
131
Q

What property of a form element object contains all of the form’s controls.

A
132
Q

What property of a form control object gets and sets its value?

A
133
Q

What is one risk of writing a lot of code without checking to see if it works so far?

A
134
Q

What is an advantage of having your console open when writing a JavaScript program?

A
135
Q

Does the document.createElement() method insert a new element into the page?

A
136
Q

How do you add an element as a child to another element?

A
137
Q

What do you pass as the arguments to the element.setAttribute() method?

A
138
Q

What steps do you need to take in order to insert a new element into the page?

A
139
Q

What is the textContent property of an element object for?

A
140
Q

Name two ways to set the class attribute of a DOM element.

A
141
Q

What are two advantages of defining a function to do create something (like the work of creating a DOM tree)?

A
142
Q

What DOM element property tells you what type of element it is?

A
143
Q

What does the element.closest() method take as its argument and what does it return?

A
144
Q

How can you remove an element from the DOM?

A
145
Q

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?

A
146
Q

What is the affect of setting an element to display: none?

A
147
Q

What does the element.matches() method take as an argument and what does it return?

A
148
Q

How can you retrieve the value of an element’s attribute?

A
149
Q

At what steps of the solution would it be helpful to log things to the console?

A
150
Q

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?

A
151
Q

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
152
Q

What is JSON?

A
153
Q

What are serialization and deserialization?

A
154
Q

Why are serialization and deserialization useful?

A
155
Q

How do you serialize a data structure into a JSON string using JavaScript?

A
156
Q

How do you deserialize a JSON string into a data structure using JavaScript?

A
157
Q

How do you store data in localStorage?

A

localStorage.setItem(key, value);

158
Q

How do you retrieve data from localStorage?

A

var storage = localStorage.getItem(key);

159
Q

What data type can localStorage save in the browser?

A

stringdata

160
Q

When does the ‘beforeunload’ event fire on the window object?

A

before the window closes

161
Q

How can you tell the difference between a method definition and a method call?

A

if it has code block or keyword for function

162
Q

Describe method definition syntax (structure).

A

function keyword with function and codeblock with keyword assigned with method

163
Q

Describe method call syntax (structure).

A

object.method(arguments)

164
Q

What is the defining characteristic of Object-Oriented Programming?

A

Objects can hold both data as properties and behavior as methods

165
Q

How is a method different from any other function?

A

it utilizes an object to hold multiple functions and is accessed using methods

166
Q

What are the four “principles” of Object-Oriented Programming?

A

Abstraction
Encapsulation
Inheritance
Polymorphism

167
Q

What is “abstraction”?

A

work with complex systems in simple ways like light switches.

168
Q

What does API stand for?

A

application programming interface

169
Q

What is the purpose of an API?

A

to communicate with a system which is simplified for the developers.

170
Q

What is the affect of setting an element to display: none?

A

It will make the display of the element not exist in the window out of document flow.

171
Q

What does the element.matches() method take as an argument and what does it return?

A

tests whether the element would be selected by the specified CSS selector with the selector being passed returning a boolean

172
Q

How can you retrieve the value of an element’s attribute?

A

using the getAttribute() method

173
Q

At what steps of the solution would it be helpful to log things to the console?

A

all of them

174
Q

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?

A

by using a loop to see if it matches the code

175
Q

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

setting it per event listen of the tab click

176
Q

Does the document.createElement() method insert a new element into the page?

A

Not until it has been appended

177
Q

How do you add an element as a child to another element?

A

target.appendChild(element)

178
Q

What do you pass as the arguments to the element.setAttribute() method?

A

‘the attribute’, what you want to set it as

179
Q

What steps do you need to take in order to insert a new element into the page?

A

create element
append text content to element.
append element to a parent

180
Q

What is the textContent property of an element object for?

A

It is used to add text content to the element before it is appended to the element.

181
Q

Name two ways to set the class attribute of a DOM element.

A

className and setattribute

182
Q

What are two advantages of defining a function to do create something (like the work of creating a DOM tree)?

A

to reutilize the function each time called and have it exist when needed

183
Q

What is this in Javascript

A

Keyword implicit parameter of where the object is being invoked from

184
Q

What does it mean to say that this is an “implicit parameter”?

A

It is a parameter that exists only when called but never explicitly written

185
Q

When is the value of this determined in a function; call time or definition time?

A

when it is called only because the argument fills the parameter

186
Q

What does this refer to in the following code snippet?

A

the object but not called so it doesn’t exist and not invoked

187
Q

Given the above character object, what is the result of the following code snippet? Why?

A

The greet is being invoked in the character object and is passing off of whatever object it is off of.

188
Q

Given the above character object, what is the result of the following code snippet? Why?

var hello = character.greet;
hello();

A

because this doesnt reference anything in lines

this doesnt reference anything on its left defaulting to window.

189
Q

How can you tell what the value of this will be for a particular function or method definition?

A

By checking what the left side of the . of this is. If it is a definition, this is nothing until called.

190
Q

How can you tell what the value of this is for a particular function or method call?

A

the object of the method when called but if not defined, it is window.

191
Q

What kind of inheritance does the JavaScript programming language use?

A

Prototypal inheritance

192
Q

What is a prototype in JavaScript?

A

A object that all created instances of a certain type of thing can be used within

193
Q

How is it possible to call methods on strings, arrays, and numbers even though those methods don’t actually exist on strings, arrays, and numbers?

A

its in the prototype object

194
Q

If an object does not have it’s own property or method by a given key, where does JavaScript look for it?

A

prototype

195
Q

What does the new operator do?

A

creates a blank, plain javascript object,
points the new object’s prototype to the constructor’s prototype property. Object.prototype is its prototype.
runs the constructor function with its arguments with this. refering to the object’s function
no return statement means object will be returned instead.

196
Q

What property of JavaScript functions can store shared behavior for instances created with new?

A

object.prototype

197
Q

What does the instanceof operator do?

A

returns a boolean of whether the right side of instanceof is an prototypal chain of the left.

198
Q

What is a client?

A

A client requests or takes a piece of functionality from a provider

199
Q

What is a server

A

It is a provider of the requests.

200
Q

Which HTTP method does a browser issue to a web server when you visit a URL

A

GET

201
Q

What three things are on the start of an HTTP start message.

A

METHOD or GET, PUT, POST,
Path
or HTTP Version

202
Q

What three things are on the start of an HTTP response message

A

HTTP Version, Status code, and Status Textf

203
Q

what are http headers

A

Give additional data about the message you are providing. Like html heads.

204
Q

WHere would you go if you wanted to learn more about a specific HTTP Headers

A

MDN and httpie

205
Q

Is a body required for a valid HTTP request or response message.

A

No

206
Q

What is AJAX?

A

Asynchronous runs in the background instead one thing at a time. You draw the page and send information over the network without blocking the user.

207
Q

What does AJAX acronym stand for?

A

Asynchronous Javascript and XML. Xml is html with strict rules. but JSON took over.

208
Q

Which object is built into the browser for making HTTP request in JavaScript

A

XMLHTTPRequest <- object function instantiating a class in the browser.

209
Q

What event is fired by XMLHttpRequest objects when they are finished loading the data from the server?

A

Load

210
Q

An XMLHttpReqest objects have an addEventListener() method just like DOM elements. How is it possible that they both share this functionality?

A

They are inherited objects OOP