ES6 Flashcards

1
Q

What is a code block? What are some examples of a code block?
es6-const-let

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

What does block scope mean?
es6-const-let

A

In JavaScript, blocks are denoted by curly braces {} , for example, the if else, for, do while, while, try catch

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

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

A

blocked-scope

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

What is the difference between let and const?
es6-const-let

A

lets can be reassigned, const cannot.

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

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

A

You can update and reassign the value, but not what is assigned to the variable

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

How should you decide on which type of declaration to use?
es6-const-let

A

everything should be const until it cannot be, then use let. Use let mainly in loops.

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

What is the syntax for writing a template literal?
es6-template-literals

A

to create a template literal, wrap your text in backticks (`). for substitution ${}

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

What is “string interpolation”?
es6-template-literals

A

The substitutions allow you to embed variables and expressions in a string. The JavaScript engine will automatically replace these variables and expressions with their values.

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

What is destructuring, conceptually?
es6-destructuring

A

provides an alternative way to assign properties of an object to variables to store and use

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

What is the syntax for Object destructuring?
es6-destructuring

A

const { property1: variable1, property2: variable2 } = object;

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

What is the syntax for Array destructuring?
es6-destructuring

A

const [x, y, z] = getScores();

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

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

A

what side the curly bracelets is on. left side is destructuring, right side is creating.

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

What is the syntax for defining an arrow function?
es6-arrow-functions

A

const variable name = (…args) => expression

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

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

A

the arrow function has an implicit return

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

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

A

Arrow functions have a lexical this and its value within the arrow function is determined by the surrounding scope.

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

What is a CLI?
command-line-basics

A

command line interface

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

What is a GUI?
command-line-basics

A

Graphical user interface

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

Give at least one use case for each of the commands listed in this exercise.
man
cat
ls
pwd
echo
touch
mkdir
mv
rm
cp
command-line-basics

A

man - command information
cat - print content of text of file
ls - list the files
pwd - check what directory youre on
echo - line of text
touch - Modification time or mtime changes when a file’s contents change.
mkdir - creates a new, empty directory
mv- move and rename files
rm - remove files or directories
cp - copies folder and files

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

What are the three virtues of a great programmer?
command-line-basics

A

Laziness, Impatience, and Hubris.

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

What is Node.js?
node-intro

A

program that allows js to be run outside of browser

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

What can Node.js be used for?
node-intro

A

commonly used to build back ends for Web applications, command-line programs, or any kind of automation that developers wish to perform.

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

What is a REPL?
node-intro

A

read, eval, print loop, allows to run language in background

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

When was Node.js created?
node-intro

A

may 2009

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

What back end languages have you heard of?
node-intro

A

Java, python, c++

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

What is a computer process?
node-process

A

a process is the instance of a computer program that is being executed by one or many threads.

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

Roughly how many computer processes are running on your host operating system (Task Manager or Activity Monitor)?
node-process

A

a lot

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

Why should a full stack Web developer know that computer processes exist?
node-process

A

because they generate application

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

What is the process object in a Node.js program?
node-process-argv

A

The process object in Node. js is a global object that can be accessed inside any module without requiring it.

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

How do you access the process object in a Node.js program?node-process-argv

A

console.log(process) or const process = require(‘process’);

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

What is the data type of process.argv in Node.js?
node-process-argv

A

an array

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

What is a JavaScript module?
node-module-system

A

a single .js file. it’s wrapped in functionality that’s easily imported and used.

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

What values are passed into a Node.js module’s local scope?
node-module-system

A

exports, require, module, __filename, and __dirname

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

Give two examples of truly global variables in a Node.js program.
node-module-system

A

process, exports, require, module, __filename, and __dirname

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

What is the purpose of module.exports in a Node.js module?
node-require

A

Module exports are the instructions that tell Node. js which bits of code (functions, objects, strings, etc.) to export from a given file so that other files are allowed to access the exported code.

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

How do you import functionality into a Node.js module from another Node.js module?
node-require

A

To include functions defined in another file in Node.js, we need to import the module. we will use the require function keyword at the top of the file.

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

What is the JavaScript Event Loop?
the-event-loop

A

JavaScript has a runtime model based on an event loop, which is responsible for executing the code, collecting and processing events, and executing queued sub-tasks.

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

What is different between “blocking” and “non-blocking” with respect to how code is executed?
the-event-loop

A

Blocking refers to operations that block further execution until that operation finishes while non-blocking refers to code that doesn’t block execution.

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

What is a directory?
node-fs-readfile

A

type of file that contains collections of files

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

What is a relative file path?
node-fs-readfile

A

A relative path refers to a location that is relative to a current directory. Relative paths make use of two special symbols, a dot (.) and a double-dot (..), which translate into the current directory and the parent directory. Double dots are used for moving up in the hierarchy.

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

What is an absolute file path?
node-fs-readfile

A

An absolute path is defined as the specifying the location of a file or directory from the root directory. like website

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

What module does Node.js include for manipulating the file system?
node-fs-readfile

A

fs module

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

What method is available in the Node.js fs module for writing data to a file?
node-fs-writefile

A

fs.writeFile()

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

Are file operations using the fs module synchronous or asynchronous?
node-fs-writefile

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

What is a client?
http-messages-recap

A

service requesters

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

What is a server?
http-messages-recap

A

workloads between the providers of a resource or service. a software program listen and respond to request

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

Which HTTP method does a browser issue to a web server when you visit a URL?
http-messages-recap

A

GET method

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

What is on the first line of an HTTP request message?
http-messages-recap

A

A start-line describing the requests to be implemented, or its status of whether successful or a failure. This start-line is always a single line. An HTTP method, The request target, The HTTP version

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

What is on the first line of an HTTP response message?
http-messages-recap

A

The start line of an HTTP response, called the status line, contains
The protocol version, usually HTTP/1.1.
A status code, indicating success or failure of the request. Common status codes are 200, 404, or 302
A status text. A brief, purely informational, textual description of the status code to help a human understand the HTTP message.
A typical status line looks like: HTTP/1.1 404 Not Found.

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

What are HTTP headers?
http-messages-recap

A

HTTP headers let the client and the server pass additional information with an HTTP request or response. An HTTP header consists of its case-insensitive name followed by a colon (:), then by its value. Whitespace before the value is ignored.

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

Is a body required for a valid HTTP message?
http-messages-recap

A

Not all requests have one: requests fetching resources, like GET, HEAD, DELETE, or OPTIONS, usually don’t need one.

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

What is NPM?
npm-intro

A

npm is the world’s largest software registry. Open source developers from every continent use npm to share and borrow packages, and many organizations use npm to manage private development

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

What is a package?
npm-intro

A

Bits of reusable code. a directory with one or more files in it

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

How can you create a package.json with npm?
npm-intro

A

Enter the root folder of your project
Run npm init
Fill out the prompts to create your package.json

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

What is a dependency and how to you add one to a package?npm-intro

A

A dependency is another package that your package needs in order to work. Dependencies are specified in your pubspec. You list only immediate dependencies—the software that your package uses directly.
. To add dependencies and devDependencies to a package.json file from the command line, you can install them in the root directory of your package using the –save-prod flag for dependencies (the default behavior of npm install) or the –save-dev flag for devDependencies.

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

What happens when you add a dependency to a package with npm?
npm-intro

A

gets stored in the package.json file and in the node module folder

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

How do you add express to your package dependencies?
express-intro

A

npm install express

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

What Express application method starts the server and binds it to a network PORT?
express-intro

A

listen method ls

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

How do you mount a middleware with an Express application?
express-hello-world

A

use method

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

Which objects does an Express application pass to your middleware to manage the request/response lifecycle of the server?
express-hello-world

A

request and respond method

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

What is the appropriate Content-Type header for HTTP messages that contain JSON in their bodies?
express-get-json

A

application/json

61
Q

What is the significance of an HTTP request’s method?
express-delete

A

allows to se up individual routes depending on what method is used. setup routes and endpoints.

62
Q

What is PostgreSQL and what are some alternative relational databases?
postgres-intro

A

relationtional database information.

63
Q

What are some advantages of learning a relational database?
postgres-intro

A

good for storing and collecting data. and having relationship between to make it easier to access

64
Q

What is one way to see if PostgreSQL is running?
postgres-intro

A

top command or sudo service postgresql status

65
Q

What is a database schema?
postgres-database

A

A collection of tables is called a schema. A schema defines how the data in a relational database should be organized

66
Q

What is a table?
postgres-database

A

Relational databases store data in relations, commonly referred to as tables

67
Q

What is a row?
postgres-database

A

A table is a list of rows each having the same set of attributes.

68
Q

What is SQL and how is it different from languages like JavaScript?
sql-select

A

primary way of interacting with relational databases.

69
Q

How do you retrieve specific columns from a database table?
sql-select

A

The query starts with the select keyword.
The select keyword is followed by a comma-separated list of column names, each surrounded by “ double quotes.
The column names are followed by a from clause specifying which table to retrieve the data from.
The query must end in a ; semicolon.

70
Q

How do you filter rows based on some specific criteria?
sql-select

A

Any rows that do not have a “category” of ‘cleaning’ have been left out.
The where clause comes after the from clause.
The where clause is checking the “category” of each row in the table.
Text values, such as ‘cleaning’ are wrapped in ‘ single quotes; not double quotes!

71
Q

What are the benefits of formatting your SQL?
sql-select

A

readiability

72
Q

What are four comparison operators that can be used in a where clause?
sql-select

A

The value of the “category” column is being compared using a single = equals sign. (Other comparisons like <, >, and != are available too)

73
Q

How do you limit the number of rows returned in a result set?
sql-select

A

The limit clause comes last.
The limit clause includes a literal integer number with no quotes to specify the maximum number of rows that should be returned.

74
Q

How do you retrieve all columns from a database table?
sql-select

A

select *

75
Q

How do you control the sort order of a result set?
sql-select

A

The sort order of the order by clause is switched to descending order with the desc keyword. its ascending by default

76
Q

How do you add a row to a SQL table?
sql-insert

A

The statement begins with the insert keyword.
The table to insert into is specified in “ double quotes.
The list of columns being inserted is wrapped in () parenthesis.
The values being inserted are also wrapped in () in parenthesis in the same order as the columns they belong to. In SQL, a list of values is referred to as a tuple.
Text values are wrapped in ‘ single quotes.
Numeric values are represented with literal numbers (or decimals if applicable).
In this particular statement, the “productId” was left out. This is because tables are often configured to auto-generate identifier attributes to avoid accidental duplicates

77
Q

What is a tuple?
sql-insert

A

a list of values is referred to as a tuple.

78
Q

How do you add multiple rows to a SQL table at once?
sql-insert

A

Data rows can be batch inserted into a database table by specifying more than one tuple of values, separated by commas.

79
Q

How do you get back the row being inserted into a table without a separate select statement?
sql-insert

A

returning *;

80
Q

How do you update rows in a database table?
sql-update

A

An SQL update statement is a means of updating rows in a database table

81
Q

Why is it important to include a where clause in your update statements?
sql-update

A

include a where clause in your update statements to only target specific rows or it would update every row in the table!

82
Q

How do you delete rows from a database table?
sql-delete

A

An SQL delete statement is how rows get removed from tables.

83
Q

How do you accidentally delete all rows from a table?
sql-delete

A

We can target specific rows to delete by including a where clause.

84
Q

What is a foreign key?
sql-join

A

A foreign key is a column or columns of data in one table that refers to the unique data values – often the primary key data – in another table. Foreign keys link together two or more tables in a relational database.

85
Q

How do you join two SQL tables?
sql-join

A

We are selecting all columns from both the “products” table and the “suppliers” table.
The join clause follows the from clause.
The join clause is instructing the database server to link the two tables by their “supplierId” column.

86
Q

How do you temporarily rename columns or tables in a SQL statement?
sql-join

A

assign alias to them “p”.”name” as “product”,

87
Q

What are some examples of aggregate functions?
sql-aggregates

A

max(), count(), min(), sum(), and every()

88
Q

What is the purpose of a group by clause?
sql-aggregates

A

The GROUP BY clause divides a table into sets. This clause is most often combined with aggregate functions that produce summary values for each of those sets.
The GROUP BY clause is used to get the summary data based on one or more groups. The groups can be formed on one or more columns.

89
Q

What are the three states a Promise can be in?
es6-promises

A

pending: initial state, neither fulfilled nor rejected.
fulfilled: meaning that the operation was completed successfully.
rejected: meaning that the operation failed.

90
Q

How do you handle the fulfillment of a Promise?
es6-promises

A

use a then statement and do something

91
Q

How do you handle the rejection of a Promise?
es6-promises

A

Appends a rejection handler callback to the promise, and returns a new promise resolving to the return value of the callback if it is called, or to its original fulfillment value if the promise is instead fulfilled.

92
Q

What is Array.prototype.filter useful for?
array-filter

A

The filter() method creates a shallow copy of a portion of a given array, filtered down to just the elements from the given array that pass the test implemented by the provided function.

93
Q

What is Array.prototype.map useful for?
array-map

A

The map() method creates a new array populated with the results of calling a provided function on every element in the calling array.

94
Q

What is Array.prototype.reduce useful for?
array-reduce

A

The reduce() method executes a user-supplied “reducer” callback function on each element of the array, in order, passing in the return value from the calculation on the preceding element. The final result of running the reducer across all elements of the array is a single value.

95
Q

What is “syntactic sugar”?
es6-classes

A

syntactic sugar is syntax within a programming language that is designed to make things easier to read or to express. It makes the language “sweeter” for human use: things can be expressed more clearly, more concisely, or in an alternative style that some may prefer

96
Q

What is the typeof an ES6 class?
es6-classes

A

its a function

97
Q

Describe ES6 class syntax.
es6-classes

A

class Person {
constructor(name) {
this.name = name;
}
getName() {
return this.name;
}
}

98
Q

What is “refactoring”?
es6-classes

A

code refactoring is the process of restructuring existing computer code—changing the factoring—without changing its external behavior. Refactoring is intended to improve the design, structure, and/or implementation of the software (its non-functional attributes), while preserving its functionality.

99
Q

What is Webpack?
webpack-intro

A

At its core, webpack is a static module bundler for modern JavaScript applications. When webpack processes your application, it internally builds a dependency graph from one or more entry points and then combines every module your project needs into one or more bundles, which are static assets to serve your content from.

100
Q

How do you add a devDependency to a package?webpack-intro

A

To add devDependencies to a package.json file, in a text editor, add an attribute called “devDependencies” that references the name and semantic version of each devDependency:

101
Q

What is an NPM script?
webpack-intro

A

The “scripts” property of your package.json file supports a number of built-in scripts and their preset life cycle events as well as arbitrary scripts.

102
Q

How do you execute Webpack with npm run?
webpack-intro

A

npm run build

103
Q

How are ES Modules different from CommonJS modules?
es6-modules

A

With CommonJS, all of the dependencies for a project are stored in one file called node_modules/. With ES modules, each dependency is stored in its files. This allows developers to better control how their dependencies are used and makes it easier to version software. useimprt andexport

104
Q

What kind of modules can Webpack support?
es6-modules

A

Webpack supports the following module types natively: ECMAScript modules. CommonJS modules. AMD modules.

105
Q

What is React?
react-elements

A

React is a JavaScript library for creating user interfaces.

106
Q

What is a React element?
react-elements

A

It is the basic building block in a react application, it is an object representation of a virtual DOM node. React Element contains both type and property.

107
Q

How do you mount a React element to the DOM?
react-elements

A

You can tell React to “mount” it into a DOM container by calling: ReactDOM.

108
Q

What is Babel?
babel-intro

A

Babel is a toolchain that is mainly used to convert ECMAScript 2015+ code into a backwards compatible version of JavaScript in current and older browsers or environments.

109
Q

What is a Plug-in?
babel-intro

A

plugins allow you to use new syntax, right now without waiting for browser support

110
Q

What is a Webpack loader?
babel-intro

A

Loaders are transformations that are applied to the source code of a module. They allow you to pre-process files as you import or “load” them. Thus, loaders are kind of like “tasks” in other build tools and provide a powerful way to handle front-end build steps. Loaders can transform files from a different language (like TypeScript) to JavaScript or load inline images as data URLs. Loaders even allow you to do things like import CSS files directly from your JavaScript modules!

111
Q

How can you make Babel and Webpack work together?
babel-intro

A
112
Q

What is JSX?
react-jsx

A

write html elements inside javascript

113
Q

Why must the React object be imported when authoring JSX in a module?
react-jsx

A

React needs to be in scope to create components through its createElement function. it will not work if you don’t import it

114
Q

How can you make Webpack and Babel work together to convert JSX into valid JavaScript?

A

webpack bundle everything together and babel will do the conversion

115
Q

What is a React component?
react-function-components

A

Components let you split the UI into independent, reusable pieces, and think about each piece in isolation. components are like JavaScript functions. They accept arbitrary inputs (called “props”) and return React elements describing what should appear on the screen.

116
Q

How do you define a function component in React?
react-function-components

A

function Welcome(props) {
return <h1>Hello, {props.name}</h1>;
}

117
Q

How do you mount a component to the DOM?
react-function-components

A

render method on the root

118
Q

What are props in React?
react-props-and-expressions

A

a type of object where the value of attributes of a tag is stored.

119
Q

How do you pass props to a component?
react-props-and-expressions

A

pass it as an attribute to the function

120
Q

How do you write JavaScript expressions in JSX?
react-props-and-expressions

A

put it around {}

121
Q

How do you create “class” component in React?
react-class-components

A

class Welcome extends React.Component {
render() {
return <h1>Hello, {this.props.name}</h1>;
}
}
To define a React component class, you need to extend React.Component:The only method you must define in a React.Component subclass is called render(). All the other methods described on this page are optional.

122
Q

How do you access props in a class component?
react-class-components

A
123
Q

What is the purpose of state in React?
react-events-and-state

A
124
Q

How to you pass an event handler to a React element?
react-events-and-state

A
125
Q

What are controlled components?
react-form-controls

A

A controlled component is a component that renders form elements and controls them by keeping the form data in the component’s state.

126
Q

What two props must you pass to an input for it to be “controlled”?

A

value

127
Q

What Array method is commonly used to create a list of React elements?
react-rendering-lists

A

map method

128
Q

What is the best value to use as a “key” prop when rendering lists?
react-rendering-lists

A

unique identifier

129
Q

What does express.static() return?
express-static

A

middleware function

130
Q

What is the local __dirname variable in a Node.js module?express-static

A

the name of current module

131
Q

What does the join() method of Node’s path module do?
express-static

A

combine a number of path into one

132
Q

What does fetch() return?
fetch

A

promise

133
Q

What does fetch() return?
fetch

A

get method

134
Q

How do you specify the request method (GET, POST, etc.) when calling fetch?
fetch

A

takes an object as its 2nd argument,

135
Q

When does React call a component’s componentDidMount method?fetch-in-react

A

componentDidMount() is invoked immediately after a component is mounted (inserted into the tree). Initialization that requires DOM nodes should go here.

136
Q

Name three React.Component lifecycle methods.
fetch-in-react

A

Mounting, Updating, and Unmounting.

137
Q

How do you pass data to a child component?
fetch-in-react

A
138
Q

What does the acronym LIFO mean?
data-structures-stacks

A

Last in first out

139
Q

What methods are available on a Stack data structure?data-structures-stacks

A

peek push pop

140
Q

What must you do to access the value at an arbitrary point in a stack (not just the “top”)?
data-structures-stacks

A

remove all value above it

141
Q

What must you do to access the value at an arbitrary point in a queue (not just the “front”)?
data-structures-queues

A

use deque method until you remove the value before it untilyou find what you’re looking for

142
Q

What methods are available on a Queue data structure?
data-structures-queues

A

enqueue dequeue and peek

143
Q

How are linked lists different from an array?
data-structures-linked-lists

A

sequential access cant randomly accessed any values you want

144
Q

How would you access an arbitrary node in a linked list (not just the “head”)?
data-structures-linked-lists

A

start with the head and go through each property

145
Q

What must the return value of myFunction be if the following expression is possible?
myFunction()();
javascript-closures

A

a function

146
Q

What does this code do?
const wrap = value => () => value;
javascript-closures

A

nction then the value

147
Q

In JavaScript, when is a function’s scope determined; when it is called or when it is defined?
javascript-closures

A

defined

148
Q

What allows JavaScript functions to “remember” values from their surroundings?
javascript-closures

A

closure