senior side Flashcards

1
Q

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

A

A code block is code within the curly braces

some examples would be function defenitions and if statements

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

What does block scope mean?

A

Block scope means that a variable is only available within the code block it was defined in

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?

A

Block 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?

A

let values are mutable and const variables are not

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?

A

we are not changing the id of the array

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?

A

let is anything you want to change and const remains the same and cant be changed

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

What is the syntax for writing template literals in ?

A

backticks ( )

${}

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

What is “string interpolation”?

A

String formatting: the ability to substitute part of the string for the values of variables or expressions. This feature is also called string interpolation.

inside a string we replace the value with the variable

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

What is destructuring, conceptually?

A

provides an alternative way to assign properties of an object to variables:

getting data from an object and storing in into variable

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

What is the syntax for Object destructuring?

A

const { firstName: fname, lastName: lname } = person;

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

What is the syntax for Array destructuring?

A

let [x, y, z] = getScores

variable name and the order their at is its index

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?

A

destructuing: brackets are on left hand side
creating: they are on the right

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

any chance you get to use destructuring then use it but dont have to use it all the time

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

what is the syntax for defining an arrow function

A

param => expression

var keyword function name = parameter => expression

let add = (x, y) => x + y;

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

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

A

Without braces, you can only use an single-line expression in the body of the arrow function.

implicitly returns a value

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

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

A

//An arrow function captures the ‘this’ value of its enclosing context.//

takes value of this from the function it was defined from

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

What is a CLI?

A

Command line Interface

to receive commands from a user in the form of lines of text

This provides a means of setting parameters for the environment, invoking executables and providing information to them as to what actions they are to perform

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

What is GUI

A

graphical user interface

is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, instead of text-based UIs, typed command labels or text navigation.

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

man man
to get the manual for the command we run
//
////
cat is used to read a file sequentially and print it to the standard output
concatenate files and print on the standard output
cat laziness.txt
//
ls -a -F
ls -a lists all contents in the working directory, including hidden files and directories

ls" on its own lists all files in the current directory except for hidden files. "ls *.
//
pwd to check and see the working directory you are on
//
echo "Hello World!"
prints out text
you can direct to new file with >
//
touch tag-your-it.txt
touch creates the blank file 
//
mkdir to make a directory
//
mv to move and rename files
//
rm to delte a file or directory
//
cp to copy a file or whole directory into a new name (-and-no-text >no-and-then-text)
//
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What are the three virtues of a great programmer?

A

laziness impatience hubris

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

cat command will print the file you give it after running cat name-of-file

pwd prints the working directory

cat laziness.txt impatience.txt hubris.txt > three-virtues.txt will create a new file named three-virtues.txt and store laziness, impatience and hubris

echo runs the string you give it right away
echo ‘Hello World!” > hello.txt will make a new file names hello.txt

mkdir command will make a directory

mv will change the name of a file
example: mv pokiemans pokemon

rm will delete a file or directort (BE CAREFUL)

cp will copy a file and give it another name if you would lie
example: cp no-and-then.txt and-then.txt
use the history command to check all the commands I ran previously

///
$ cat oceans.txt > continents.txt
> takes the standard output of the command on the left and redirects it to the file on the right.

///
ls -a lists all contents in the working directory, including hidden files and directories
///
mkdir
$ mkdir media
mkdir takes in a directory name as an argument, and then creates a new directory in the current working directory. Here we used mkdir to create a new directory named media/.
///
rm
$ rm waterboy.txt
rm deletes files. Here we remove the file waterboy.txt from the file system.
///
rm -r
$ rm -r comedy
rm -r deletes a directory and all of its child directories.

touch
$ touch data.txt
touch creates a new file inside the working directory. It takes in a file name as an argument, and then creates a new empty file in the current working directory. Here we used touch to create a new file named keyboard.txt inside the 2014/dec/ directory.

If the file exists, touch is used to update the modification time of the file

Use the ls command to list the contents of your current working directory. Try it again with the -a and -F options.
Use the ls command to list the contents of the lfz-staff/ directory. Try it again with the -a and -F options.

Use the pwd command to write your current working directory to a new file named i-was-here.txt like this:
pwd > i-was-here.txt

Use the echo command to print the string ‘Hello, World!’ to the terminal.
Use the echo command to write the string ‘Hello, World!’ to a new file named hello.txt like this:
echo ‘Hello, World!’ > hello.txt

Use the touch command to create a new file named tag-youre-it.txt.
Use the touch command to create a new file named boop.txt inside of the snoot/ directory (i.e. snoot/boop.txt).
Use the ls command to list the contents of the snoot/ directory.
mkdir
Use the ls command to list the contents of the lfz-staff/ directory and write the results to a new file at lfz-staff/contents.txt like this:
ls -aF lfz-staff > lfz-staff/contents.txt

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

main takeaway is it gets this from the parent scope

A

syntax of arrow function
have to be passing it as a callback function or define it in a variable

const add1 = (x,y) => {
return x + y
}

const result1 =add1(12,56)

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

Learned so far on senior side

A

const/let
template literals
arrow functions
destructuring

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

What is node.js?

A

Environment to run JavaScript code outside of the browser

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What can Node.js be used for?
It is commonly used to build back ends for Web applications, command-line programs, or any kind of automation that developers wish to perform.
26
What is a REPL?
Read-eval-printLoop takes input ,reads input , evaluates input, prints the results
27
When was Node.js created?
2009
28
What back end languages have you heard of?
c++, c#, ruby python,PHp node, java, python, c#, php c++
29
What is the process object in node.js
the process object is a global that provides information about, and control over, the current Node.js process. As a global, it is always available to Node.js applications without using require(). It can also be explicitly accessed using require(): Gives information on whatever the current process running in Node.js is gloablly accessable objec that contains info
30
How do you access the process object in a Node.js program?
passing in the process object as an argument | process is a variable
31
What is the data type of process.argv in Node.js?
Array
32
The process.argv property returns an array containing the command line arguments passed when the Node.js process was launched. The first element will be process.execPath. See process.argv0 if access to the original value of argv[0] is needed. The second element will be the path to the JavaScript file being executed. The remaining elements will be any additional command line arguments.
process. argv[0] process.execpath proces. argv[1]. path to the javascript file proces. argv[2] will be any command line arguments you type
33
notes to remember
every application is a process process object gives us info about app that is running process.argv is array allows us to access data within array we dont care about index 1 or 2
34
What is a module?
In JavaScript, a "module" is a single .js file. Node.js supports modules using a system heavily influenced by CommonJS.
35
What values are passed into a Node.js module's local scope?
exports , require , module , __filename , __dirname
36
Give two examples of truly global variables in a Node.js program.
Process | Console
37
we will care most of exports and require function module.exports require is how we get stuff from other files const add = (x,y) => x + y module.exports = add ``` New file const add = require('./add') ``` console.log('Add result:', add(4,5)) whatever exports is then thats what require is going to return
bunch of ways to export multipe things module.exports = { add:add subtract: subtract divide: divide multiply: multiply } ops. add module. exports starts as an empty object exports. add = add exports. subtract = subtract can not reassign exports
38
What is the purpose of module.exports in a Node.js module?
The purpose is to export data to use in another file
39
How do you import functionality into a Node.js module from another Node.js module?
use the require function and pass in the relative path of the file
40
parseInt does not include decimal coverts string to number
41
What is the JavaScript Event Loop?
the event loops job is to look at the stack and if it is empty it takes first thing in que and runs it responsible for executing the code, collecting and processing events, and executing queued sub-tasks. its the process of the call stack being emptied and then runs whats in the stack and pops it and repeats
42
What is different between "blocking" and "non-blocking" with respect to how code is executed?
blocking is any code that prevents anything else from happening non-blocking code is something that is taking a long time we kinda push it over to the side so everything else can render
43
What is a directory?
A directory is a folder that contains files
44
What is a relative file path?
A path that links to something withi the same directory
45
What is an absolute file path?
a path that lead all the way to the root of the file
46
What module does Node.js include for manipulating the file system?
fs module
47
What method is available in the Node.js fs module for writing data to a file?
writeFile method
48
Are file operations using the fs module synchronous or asynchronous?
asynchronous
49
if you have a number to a string then you dont need to stringify it will all become a string
50
JSON.stringify(data,null,2)
51
FINAL PROJECT
create doc name doc put heading on top and share follow instructions create figma rename it share file with scott and give access create account name it database postgres share with scott ``` PLANNING come up with idea CRUD create read update delete !!!!do not use third party API!!! ``` START USING CSS LIBRARIES bootstrap has most utility classes dsiplay position' margin padding BEST To do it about something we like CAR WASH PAGE WORKOUT PAGE
52
What is a client?
client is a piece of computer hardware or software that accesses a service made available by a server as part of the client-server model of computer networks the one who is making the request Program that makes request o another computer or program
53
What is a server?
a server is a piece of computer hardware or software (computer program) that provides functionality for other programs or devices, called "clients". A programm that listens to incoming response or request
54
Which HTTP method does a browser issue to a web server when you visit a URL?
GET Request
55
What is on the first line of an HTTP request message?
An HTTP method, a verb (like GET, PUT or POST) or a noun (like HEAD or OPTIONS), that describes the action to be performed. For example, GET indicates that a resource should be fetched or POST means that data is pushed to the server (creating or modifying a resource, or generating a temporary document to send back). The request target, usually a URL, or the absolute path of the protocol, port, and domain are usually characterized by the request context. The format of this request target varies between different HTTP methods. It can be The HTTP version, which defines the structure of the remaining message, acting as an indicator of the expected version to use for the response.
56
What is on the first line of an HTTP response message?
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.
57
What are HTTP headers?
HTTP headers are information about the request being made connection: common value of keep alive
58
Is a body required for a valid HTTP message?
no 204 no content is when none send body
59
What is NPM?
Node package manager npm is the world's largest software registry. Open source developers from every continent use npm to share and borrow packages, and many organizations use npm to manage private development as well. npm consists of three distinct components: the website the Command Line Interface (CLI) the registry Package manager for javascript
60
What is a package?
collection of files that put together make up a single program or unit
61
How can you create a package.json with npm?
be in root of your directory and run | npm init --y'
62
What is a dependency and how to you add one to a package?
Dependery is packages required to use in your code | npm install package name you want
63
What happens when you add a dependency to a package with npm?
it updated the json file to include the depency you just added adds list of dependencies to your package.json
64
How do you add express to your package dependencies?
npm install express
65
What Express application method starts the server and binds it to a network PORT?
listen method
66
if you run into a error with port then another port is listening on same part
67
How do you mount a middleware with an Express application?
app.use()
68
Which objects does an Express application pass to your middleware to manage the request/response lifecycle of the server?
app object
69
EXPRESS
Bind application-level middleware to an instance of the app object by using the app.use() and app.METHOD() functions, where METHOD is the HTTP method of the request that the middleware function handles (such as GET, PUT, or POST) in lowercase. ERROR HANDLING MIDDLEWARE Error-handling middleware Error-handling middleware always takes four arguments. You must provide four arguments to identify it as an error-handling middleware function. Even if you don’t need to use the next object, you must specify it to maintain the signature. Otherwise, the next object will be interpreted as regular middleware and will fail to handle errors. Define error-handling middleware functions in the same way as other middleware functions, except with four arguments instead of three, specifically with the signature (err, req, res, next)): app.use((err, req, res, next) => { console.error(err.stack) res.status(500).send('Something broke!') })
70
What is the appropriate Content-Type header for HTTP messages that contain JSON in their bodies?
application JSON
71
What is the significance of an HTTP request's method?
HTTP defines a set of request methods to indicate the desired action to be performed for a given resource. HTTP defines methods (sometimes referred to as verbs, but nowhere in the specification does it mention verb) to indicate the desired action to be performed on the identified resource.
72
path is arbitrary but needs to make sense path has to start with forward slash url parameters are indicated by colon(can pass info in URL) req.params.NAmeGiven res.sendStatus() no content
73
What does the express.json() middleware do and when would you need it?
It parses incoming requests with JSON payloads and is based on body-parser. Returns middleware that only parses JSON and only looks at requests where the Content-Type header matches the type option. does: parses request body needed: needed when we want to send data to our server
74
Json middleware is a function apply any middleWare by using app.use everyrequest that comes in will run through jsonMiddleWare post,put, patch will check to see if there is json data if there is then it will parse data in body req.body is created by JSON middleware
if req.body is undefined then no jsonMiddleware was applied test code first then start writing everything else
75
What is PostgreSQL and what are some alternative relational databases?
PostgreSQL is a powerful, free, open source Relational Database Management System (RDBMS). mySQL microsoft sql Oracle by Oracle Corporation
76
What are some advantages of learning a relational database?
Easy Access to data accurate extremely used Many problem domains can be modeled well using a relational database. If you are storing related data, then a relational database is probably a good first choice! For example, you may be storing data about students, teachers, courses, and classrooms. You can imagine that there are relationships between these things.
77
What is one way to see if PostgreSQL is running?
sudo service postgresql status in terminal
78
What is a relational database?
A system used to maintain relational databases is a relational database management system (RDBMS). Many relational database systems are equipped with the option of using the SQL (Structured Query Language) for querying and maintaining the database.[2]
79
how to start postgresql | how to stop postgresql
sudo service postgresql start | sudo service postgresql stop
80
psql -c '\l' databases we have pgweb starts another application \ its own applicaton that someone built tool we use
81
What is a database schema?
A collection of tables is called a schema. A schema defines how the data in a relational database should be organized. In relational databases, you typically have to define your schema up front and the database server will make sure that any data being written to the database conforms to that schema. instruction s or layout of all our tables including column's describes our database
82
What is a table?
columns and rows
83
What is a row?
Each row, which represents a complete record of specific item data, holds different data within the same structure. A row is where the data is stored each row contains data
84
- d database - f execute file path to file psql -d pagila -c '\dt'
85
What is SQL and how is it different from languages like JavaScript?
SQL is a declarative programming language. In declarative languages, programmers describe the results they want and the programming environment comes up with its own plan for getting those results SQL is the language we use to interact with the database declarative language
86
How do you retrieve specific columns from a database table?
select statement and gets the values you pass into it
87
How do you filter rows based on some specific criteria?
Where clause to be more specific
88
What are the benefits of formatting your SQL?
it is easier to query for specifics items | Easier to read
89
What are four comparison operators that can be used in a where clause?
> < = !=
90
How do you limit the number of rows returned in a result set?
use the limit keyword and give it a limit number
91
How do you retrieve all columns from a database table?
with the *
92
How do you control the sort order of a result set?
with the order by clause in the select statement
93
How do you add a row to a SQL table?
insert into "Specify row" ('name", 'description') | values to insert
94
What is a tuple?
list of values in parenthesis ()
95
How do you add multiple rows to a SQL table at once?
after tuple comma and then another one values within parenthesis seperated by comas
96
How do you get back the row being inserted into a table without a separate select statement?
returning then specify which column we want to return
97
How do you update rows in a database table?
update specify table and then set keyword which columns we want to update where clause to specify
98
Why is it important to include a where clause in your update statements?
so that you do not update everything instead of a single row
99
How do you delete rows from a database table?
delete from then what you want to delete
100
How do you accidentally delete all rows from a table?
delete without where clause
101
``` select :firstName:, 'lastname, title' from "castMembers' join 'actors using ('actorId') join 'films' usiong ('filmId') where "films".filmId = 1; ```
``` select :firstName:, 'lastname, title' from "castMembers' join 'actors using ('actorId') join 'films' usiong ('filmId') where 'actors'.'actorId' = 1; ```
102
What is a foreign key?
Notice how each row in the "products" table has a "supplierId" column. That column specifically refers to values in the "supplierId" column of the "suppliers" table This is known as a foreign key. columns that links 2 tables together
103
How do you join two SQL tables?
join clause and column name they share
104
How do you temporarily rename columns or tables in a SQL statement?
table name.name as new name to rename table name. name as name we want
105
What are some examples of aggregate functions?
min() sum()
106
What is the purpose of a group by clause?
you want to separate rows into groups and perform aggregate functions on those groups of rows. This is done with a group by clause.
107
What are the three states a Promise can be in?
pending, | fullfilled, rejected
108
How do you handle the fulfillment of a Promise?
.then method pass it a callback
109
How do you handle the rejection of a Promise?
.catch
110
What is Array.prototype.filter useful for?
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. Useful to filter out things that meet a certain code 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 allows us to filter an array
111
What is Array.prototype.map useful for?
The map() method creates a new array populated with the results of calling a provided function on every element in the calling array. Any time we want to transform data into new array
112
What is Array.prototype.reduce useful for?
To reduce an array to a single value gets the previous value from the
113
What is "syntactic" sugar?
In computer science, syntactic sugar is syntax within a programming language that is designed to make things easier to read or to express.
114
What is the typeof an ES6 class?
function
115
Describe ES6 class syntax.
class Person { } we can add methods constructor method( )
116
What is "refactoring"?
code refactoring is the process of restructuring existing computer code—changing the factoring—without changing its external behavior Cleaning up code without changing its behavior
117
``` defining class name student class Student ``` const {firstName, lastName} = this being detructured
118
What is Webpack?
Used to take a bunch of javascript files into one file
119
How do you add a devDependency to a package?
npm install --save-dev name of devDependency
120
What is an NPM script?
An npm script is a convenient way to bundle common shell commands for your project. They are typically commands, or a string of commands, which would normally be entered at the command line in order to do something with your application.
121
How do you execute Webpack with npm run?
npm run build add name of script at the end
122
webpack is a tool we use folder structure: src (where we write our code) (web pack will look here) dist folder (short for ditruubion) html goes here or css all website files goes here now called public important note all files have to be converted within src folder to use import statements
123
How are ES Modules different from CommonJS modules?
ES modules are the standard for JavaScript, while CommonJS is the default in Node. js. common js modules use the require keyword I guess you can put commonJS uses the require keyword while ES doesnt and uses import and export instead of module.exports
124
What kind of modules can Webpack support?
ECMAScript modules. CommonJS modules. AMD modules.
125
Names exports can export multiple things but it has to be wrapped in curly braces and name must match within import export default. import name doesnt matter
126
What is React?
A JavaScript library for building user interfaces
127
What is a React element?
React elements are plain objects that describe the DOM element information inside to describe what it has in it
128
How do you mount a React element to the DOM?
create root | render method on root and pass in the node
129
What is Babel?
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. Here are the main things Babel can do for you: Transform syntax Polyfill features that are missing in your target environment (through a third-party polyfill such as core-js) Source code transformations (codemods) Babel can convert one version of javascript to another
130
What is a Plug-in?
is a software component that adds a specific feature to an existing computer program.
131
What is a Webpack loader?
``` 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. ``` Allows us to connect other applications into the web pack process
132
How can you make Babel and Webpack work together?
npm install -D babel-loader @babel/core @babel/preset-env webpack babel-loader
133
Main takeaways from babel-intro exercise Webpack takes a bunch of files and converts it into one babel converts javascript we can connect them both with babel-loader they are both separate application
134
What is JSX?
It is called JSX, and it is a syntax extension to JavaScript Allows us to write html like syntax to describe our UI within our javascript
135
Why must the React object be imported when authoring JSX in a module?
Fundamentally, JSX just provides syntactic sugar for the React.createElement(component, props, ...children) function. The JSX code: JSX uses the react component in order to implement jsx into react JSX gets converted by babel
136
How can you make Webpack and Babel work together to convert JSX into valid JavaScript?
babel-loader and the regex as a test plugins: [ '@babel/plugin-transform-react-jsx'
137
jsx code read

Hello

opening tag for the jsx h1 element with text content
138
What is a React component?
Components let you split the UI into independent, reusable pieces, and think about each piece in isolation.
139
How do you define a function component in React?
``` function Welcome(props) { return

Hello, {props.name}

; } ``` ``` class Welcome extends React.Component { render() { return

Hello, {this.props.name}

; } } Any funtion component that returns jsx ```
140
How do you mount a component to the DOM?
ReactDOM.render then pass in the cusotm fucntion and what it should be attatched to(node) pass it to render method
141
What are props in React?
Pass custom data to your component. Props are arguments passed into React components Props are how we pass data into our components
142
How do you pass props to a component?
state the component name and then name and value
143
How do you write JavaScript expressions in JSX?
You can put any valid JavaScript expression inside the curly braces in JSX.
144
How do you create "class" component in React?
with the class keyword then extends React.Component
145
How do you access props in a class component?
with this.props
146
class defenition for the class CustomButton that extends the component property of the react object constructor(props) constructor method definition this.setState()({ isClicked: true })
147
What is the purpose of state in React?
used to contain data or information about the component A component's state can change over time; whenever it changes, the component re-renders State is there to track information about the component
148
How to you pass an event handler to a React element?
you pass it a function and what event we want it to listen to
149
What are controlled components?
inputs values who are controlled by react
150
What two props must you pass to an input for it to be "controlled"?
onChange and value
151
What Array method is commonly used to create a list of React elements?
map
152
What is the best value to use as a "key" prop when rendering lists?
whatever is uniqe typicallly id outermost element needs the key property
153
What does express.static() return?
function serveStatic
154
What is the local __dirname variable in a Node.js module?
It returns the folder path of the current JavaScript file. It returns the name the of current working directory. gives us absolute path that the module is in
155
What does the join() method of Node's path module do?
The path.join() method joins all given path segments together using the platform-specific separator as a delimiter, then normalizes the resulting path.
156
What does fetch() return?
A Promise that resolves to a Response object.
157
What is the default request method used by fetch()?
Get
158
How do you specify the request method (GET, POST, etc.) when calling fetch?
you set it in the option object and then give it in the method property
159
When does React call a component's componentDidMount method?
componentDidMount() is invoked immediately after a component is mounted (inserted into the tree). Initialization that requires DOM nodes should go here. If you need to load data from a remote endpoint, this is a good place to instantiate the network request. after te
160
Name three React.Component lifecycle methods.
ComponentDidMount() ComponentWillMount() ComponetDidUpdate()
161
How do you pass data to a child component?
via props
162
What does the acronym FIFO mean?
First in first out
163
What methods are available on a Queue data structure?
enqueue(value) - adds a value to the "back" of the queue | dequeue() - removes the "front" value from the queue and returns it
164
What must you do to access the value at an arbitrary point in a queue (not just the "front")?
You need to traverse the stack until you get where you want to go
165
What does the acronym LIFO mean?
last in first out
166
What methods are available on a Stack data structure?
Pop Push Peek
167
What must you do to access the value at an arbitrary point in a stack (not just the "top")?
You need to traverse the stack until you get where you want to go
168
How are linked lists different from an array?
Linked lists are sequential access (like a queue), not random access (like an array).
169
How would you access an arbitrary node in a linked list (not just the "head")?
.next
170
FOR DATA STRUCTURE QUEUES enqueue(value) - adds a value to the "back" of the queue dequeue() - removes the "front" value from the queue and returns it
171
FOR LINKEDLIST
.data - contains the node's value. .next a reference to the next node in the list, if there is one. If there is no "next" node in the list, this property is typically set to null.
172
What must the return value of myFunction be if the following expression is possible? myFunction()();
return must be another function
173
``` What does this code do? const wrap = value => () => value; ```
sets value to the the next anonymous function
174
In JavaScript, when is a function's scope determined; when it is called or when it is defined?
when it is called
175
What allows JavaScript functions to "remember" values from their surroundings?
This environment consists of any local variables that were in-scope at the time the closure was created.