JavaScript Flashcards

1
Q

What is the purpose of variables?

A

Let you store data in your program for later use or for modification

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

How do you declare a variable?

A

var variableName;

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

Equals 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

First character: Letter, _, $

Other characters: Letter, _, $, Number

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

Capital letters are different from lowercase letters

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

A literal representation of characters (holds letters)

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

Contains numerical data

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

True/false logic

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

Assigns a value to a variable

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

Equals sign without var

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

Undefined: the variable is declared but doesn’t have a value/hasn’t been assigned
Null indicates the variable has an empty or non-existent value, must be assigned

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

Makes it easier and clearer to keep track of your variables

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

Give five examples of JavaScript primitives.

A

String, Number, Boolean, Null, Undefined

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

What is string concatenation?

A

Combining strings into a new string

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

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

A

Add numbers together or concatenate strings

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

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

A

Adds the value on the right side to the variable and assigns the result to the variable

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

What are objects used for?

A

Storing multiple values in a single collection

Consolidating like data and modeling real world objects

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

What are object properties?

A

Essentially variables attached to an object

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

Describe object literal notation.

A

Object name {property name: value…}

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

How do you remove a property from an object?

A

Delete operator

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

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

A

Dot notation or bracket notation

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

What are arrays used for?

A

Storing a list of values with a particular order

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

Describe array literal notation.

A

var newArrayName = [];

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

How are arrays different from “plain” objects?

A

Arrays are organized into numeric lists

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

What number represents the first index of an array?

A

0

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

What is the length property of an array?

A

The number of values the array contains

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

How do you calculate the last index of an array?

A

The length of the array minus one

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

What is a function in JavaScript?

A

A code block that does a particular task and can be reused

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

Describe the parts of a function definition.

A
function functionName (parameter(s)names){
	code block
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

Describe the parts of a function call.

A

functionName(parater(s)youWantToPass)

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

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

A

Function definition is writing the code for the function

Function call is telling the function and all of it’s to run in that instance

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

What is the difference between a parameter and an argument?

A

Parameter is the thing that gets passed within the function definition.
Argument is the thing that gets passed when the function is called.

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

Why are function parameters useful?

A

Allow us to give data to functions for functions to perform operations on them

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

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

A

Return statement determines the value the function returns

It ends the execution of a function

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

Why do we log things to the console?

A

Helps to verify that our code is working as intended and to help debug
For development only

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

What is a method?

A

A function on an object

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

How is a method different from any other function?

A

A function is a set of instructions that perform a task and a method is a set of instructions that are associated with an object

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

How do you remove the last element from an array?

A

Pop()

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

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

A

Floor method of the math object

Math.floor()

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

How do you generate a random number?

A

Random method of the math object

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

How do you delete an element from an array?

A

Splice

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

How do you append an element to an array?

A

Push method

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

How do you break a string up into an array?

A

Use the split method and pass in an empty space (‘ ‘)

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

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

A

No. String are immutable

Console log the strings.

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

Roughly how many string methods are there according to the MDN Web docs?

A

Around 50

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

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

A

Not always

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

Roughly how many array methods are there according to the MDN Web docs?

A

Around 30-40. (38)

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

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

A

MDN (the OFFICIAL source of truth)

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

Give 6 examples of comparison operators.

A

> ,

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

What is the purpose of an if statement?

A

Make decisions, compare values, make branching logic

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

Describe the syntax (structure) of an if statement.

A

If (condition to check{
Code block
}

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

What are the three logical operators?

A

! (not), ||(or), &&(and)

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

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

A

Using a logical operator

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

What is the purpose of a loop?

A

Lets you repeat code over and over

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

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

A

Check to see if the loop should run again

Needs to eventually stop the loop

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

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

A

One full pass/run of the code block inside of the loop

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

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

A

Before each iteration

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

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

A

Before each iteration

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

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

A

At the beginning of each subsequent iteration

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

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

A

The end of each loop iteration and before the next evaluation of condition.

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

What does the ++ increment operator do?

A

Adds one to the variable

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

How do you iterate through the keys of an object?

A

For in loop

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

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

A

QuerySelector and GetElementById

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

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

A

GetElementsByTagName

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

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

A

So we don’t have to consciously query the dom

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

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

A

.dir

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

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

A

Takes an element, id, class (any valid css selector)

Returns the first instance of that selector

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

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

A

Take a css selectors

Returns a NodeList

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

Why do we log things to the console?

A

To confirm the data as we write the code

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

What is the purpose of events and event handling?

A

Have code run based on when things happen

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

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

A

Add event listener

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

What is a callback function?

A

Any function that we do not call directly

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

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

A

Event object

It gets named event or e but technically can have any name

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

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

A

Point of origin for the event

Check MDN

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

What is the difference between these two snippets of code?

element. addEventListener(‘click’, handleClick)
element. addEventListener(‘click’, handleClick())

A

1st one just has a function for the handle click

2nd has a callback function for the handle click

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

What is the className property of element objects?

A

Class Attribute value

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

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

A

Classname.property

82
Q

What is the textContent property of element objects?

A

Represents the Content of the node and it’s descendants

83
Q

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

A

Query the dom and then use .textContent

84
Q

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

A

No, if the function doesn’t need the callback

85
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

More complicated

86
Q

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

A

Calling dom over and over is taxing on the browser

And we don’t want to rely on text content

87
Q

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

A

Focus

88
Q

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

A

Blur

89
Q

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

A

Input

90
Q

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

A

Submit event

91
Q

What does the event.preventDefault() method do?

A

Prevents the browser from automatically reloading with the submitted content

92
Q

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

A

The list events will remain on the html page

93
Q

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

A

.elements

94
Q

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

A

.value

95
Q

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

A

The errors can compound and it gets even harder to fix later

96
Q

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

A

To quickly see and test what you’re coding and find errors

97
Q

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

A

No, it creates a new element, but doesn’t put it into the page

98
Q

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

A

parentName.appendChild(childName)

99
Q

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

A

element.setAttribute(name, attribute)

100
Q

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

A

Use document.createElement(), specify the type of child element you want to make and assign it to a variable. Choose a parent element that the variable will be appended to. Use quereySelector and assign it to a variable. Then use .appendChild to append the child variable to the parent variable.

101
Q

What is the textContent property of an element object for?

A

To get the text content an html element has

102
Q

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

A

.className and .setAttribute

103
Q

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

A

Readability

Repeat a process over and over

104
Q

Give two examples of media features that you can query in an @media rule.

A

Width, resolution, hover, height

105
Q

What is a method?

A

A function which is a property of an object

106
Q

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

A

Definitions include a code block and call is just the object dot method name.

107
Q

Describe method definition syntax (structure).

A

Define a variable
Assign it with an object literal
Add properties with functions

108
Q

Describe method call syntax (structure).

A

ObjectName.methodName()

109
Q

How is a method different from any other function?

A

A method is part of an object

110
Q

What is the defining characteristic of Object-Oriented Programming?

A

Creating objects that both store data and functionality.

111
Q

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

A

Abstraction, encapsulation, inheritance, polymorphism

112
Q

What is “abstraction”?

A

Simplifying complex concepts/ideas

Hiding complex functionality behind simple functionality

113
Q

What does API stand for?

A

Application Programming Interface

114
Q

What is the purpose of an API?

A

Allows users to use abstraction of software

To share functionality of an application to other users

115
Q

What is this in JavaScript?

A

An implicit parameter that refers to the object that exists at call time

116
Q

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

A

A parameter that is available in a function’s code block even though it was never explicitly declared

117
Q

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

A

Call time

118
Q
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);
  }
};
A

Character object

119
Q
Given the above character object, what is the result of the following code snippet? Why?
var hello = character.greet;
hello();
A

It’s a me undefined

because it’s referring to the window object and the window object doesn’t have a firstName property

120
Q

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

A

The object containing this

121
Q

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

A

Left of the dot at the method call.

122
Q

What kind of inheritance does the JavaScript programming language use?

A

Prototypal inheritance

123
Q

What is a prototype in JavaScript?

A

An object that contains properties and methods that can be used by other objects.

124
Q

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?

A

The prototype has the methods and the strings and arrays can use the methods

125
Q

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

A

The prototype chain

126
Q

What does the new operator do?

A
  1. Creates a new blank JS object
  2. Adds a property of proto to it
  3. All the passed in parameters are bound to the new object with the this keyword
  4. Returns the object
127
Q

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

A

Inheritance

128
Q

What does the instanceof operator do?

A

Checks if the passed in created object comes from the passed in constructor

129
Q

What is a “callback” function?

A

A function that is passed to another function as an argument

130
Q

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?

A

setTimeout

131
Q

How can you set up a function to be called repeatedly without using a loop?

A

setInterval

132
Q

What is the default time delay if you omit the delay parameter from setTimeout() or setInterval()?

A

0 seconds

133
Q

What do setTimeout() and setInterval() return?

A

timeoutId

134
Q

What is a client?

A

The one that makes the request to get info/services from a server

135
Q

What is a server?

A

Wait for requests to come in and answer requests/provide services

136
Q

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

A

GET request

137
Q

What three things are on the start-line of an HTTP request message?

A

Method, request type, version that is coming in

138
Q

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

A

Protocol version, status code, text

139
Q

What are HTTP headers?

A

Let’s you pass additional information related to the request

140
Q

Where would you go if you wanted to learn more about a specific HTTP Header?

A

MDN documentation

141
Q

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

A

No

142
Q

What is AJAX?

A

JQuerey libaray that lets you make asynchronous HTTP requests to make a scynchronous functionality for your webpages

143
Q

What does the AJAX acronym stand for?

A

Asynchonous Javascript and XML

144
Q

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

A

XHR

145
Q

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

A

Load event

146
Q

Bonus Question: An XMLHttpRequest object has an addEventListener() method just like DOM elements. How is it possible that they both share this functionality?

A

By using Prototype

147
Q

What is a code block? What are some examples of a code block?

A

A local scope of code, where variables declared inside only can work inside (anything inside curly braces
If statements, while loops

148
Q

What does block scope mean?

A

Whatever is defined inside of the block, only exists inside of the block

149
Q

What is the scope of a variable declared with const or let?

A

Block-scoped

150
Q

What is the difference between let and const?

A

Let can be reassigned a value but const is immutable and cannot be changed

151
Q

Why is it possible to .push() a new value into a const variable that points to an Array?

A

The memory address of the array is the same, changing the array values, doesn’t alter this

152
Q

How should you decide on which type of declaration to use?

A

If you’re gonna have a changing variable, use let, otherwise const (default to const)

153
Q

What is destructuring, conceptually?

A

A way to create variables from object properties or indexes in the array immediately in one line

154
Q

What is the syntax for Object destructuring?

A

Const {propertyVariable} = objectName;

155
Q

What is the syntax for Array destructuring?

A

Const [indexVariable] = arrayName;

156
Q

How can you tell the difference between destructuring and creating Object/Array literals?

A

{} on the right of the = is creating

{} on the left of the = is destructuring

157
Q

What is the syntax for writing a template literal?

A

Back tick, string content, ${variableName}, back tick

158
Q

What is “string interpolation”?

A

When you can directly bring the value of a variable into a string

159
Q

What is the syntax for defining an arrow function?

A

Parameter(s) => arguments

160
Q

When an arrow function’s body is left without curly braces, what changes in its functionality?

A

It has an implicit return statement

Having curly brackets makes it work like a standard function block

161
Q

How is the value of this determined within an arrow function?

A

They treat this as it is when it is defined

162
Q

What kind of inheritance does the JavaScript programming language use?

A

Prototypal inheritance

163
Q

What is a prototype in JavaScript?

A

An object that contains properties and methods that can be used by other objects.

164
Q

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?

A

The prototype has the methods and the strings and arrays can use the methods

165
Q

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

A

The prototype chain

166
Q

What does the new operator do?

A
  1. Creates a new blank JS object
  2. Adds a property of proto to it
  3. All the passed in parameters are bound to the new object with the this keyword
  4. Returns the object
167
Q

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

A

Inheritance

168
Q

What does the instanceof operator do?

A

Checks if the passed in created object comes from the passed in constructor

169
Q

What is a “callback” function?

A

A function that is passed to another function as an argument

170
Q

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?

A

setTimeout

171
Q

How can you set up a function to be called repeatedly without using a loop?

A

setInterval

172
Q

What is the default time delay if you omit the delay parameter from setTimeout() or setInterval()?

A

0 seconds

173
Q

What do setTimeout() and setInterval() return?

A

timeoutId

174
Q

What is a client?

A

The one that makes the request to get info/services from a server

175
Q

What is a server?

A

Wait for requests to come in and answer requests/provide services

176
Q

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

A

GET request

177
Q

What three things are on the start-line of an HTTP request message?

A

Method, request type, version that is coming in

178
Q

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

A

Protocol version, status code, text

179
Q

What are HTTP headers?

A

Let’s you pass additional information related to the request

180
Q

Where would you go if you wanted to learn more about a specific HTTP Header?

A

MDN documentation

181
Q

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

A

No

182
Q

What is AJAX?

A

JQuerey libaray that lets you make asynchronous HTTP requests to make asynchronous functionality for your webpages

183
Q

What does the AJAX acronym stand for?

A

Asynchonous Javascript and XML

184
Q

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

A

XHR

185
Q

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

A

Load event

186
Q

Bonus Question: An XMLHttpRequest object has an addEventListener() method just like DOM elements. How is it possible that they both share this functionality?

A

By using Prototype

187
Q

What is a code block? What are some examples of a code block?

A

A local scope of code, where variables declared inside only can work inside (anything inside curly braces
If statements, while loops

188
Q

What does block scope mean?

A

Whatever is defined inside of the block, only exists inside of the block

189
Q

What is the scope of a variable declared with const or let?

A

Block-scoped

190
Q

What is the difference between let and const?

A

Let can be reassigned a value but const is immutable and cannot be changed

191
Q

Why is it possible to .push() a new value into a const variable that points to an Array?

A

The memory address of the array is the same, changing the array values, doesn’t alter this

192
Q

How should you decide on which type of declaration to use?

A

If you’re gonna have a changing variable, use let, otherwise const (default to const)

193
Q

What is destructuring, conceptually?

A

A way to create variables from object properties or indexes in the array immediately in one line

194
Q

What is the syntax for Object destructuring?

A

Const {propertyVariable} = objectName;

195
Q

What is the syntax for Array destructuring?

A

Const [indexVariable] = arrayName;

196
Q

How can you tell the difference between destructuring and creating Object/Array literals?

A

{} on the right of the = is creating

{} on the left of the = is destructuring

197
Q

What is the syntax for writing a template literal?

A

Back tick, string content, ${variableName}, back tick

198
Q

What is “string interpolation”?

A

When you can directly bring the value of a variable into a string

199
Q

What is the syntax for defining an arrow function?

A

Parameter(s) => arguments

200
Q

When an arrow function’s body is left without curly braces, what changes in its functionality?

A

It has an implicit return statement

Having curly brackets makes it work like a standard function block

201
Q

How is the value of this determined within an arrow function?

A

They treat this as it is when it is defined