Javascript Flashcards

1
Q

What are the 3 main types of Scope?

A
  1. Global Scope
  2. Block Scope
  3. Function Scope
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Does map() return a new array?

A

Yes

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

What is a Higher Order Function?

A

A higher order function is a function that takes a function as an argument, or returns a function.

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

What is Currying?

A

Currying is a technique of evaluating a function with multiple arguments, into a sequence of function with a single argument.

In My Words:

Currying is when you take a function with multiple arguments and divide those arguments over multiple functions within the same function.

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

What is closure?

A

A closure is a feature in JavaScript where an inner function has access to the outer (enclosing) function’s variables — a scope chain.

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

What is Functional Programming?

A

Is when you use Pure Functions almost exclusively.

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

What is a Pure Function?

A
  1. Given the same input, will always return the same output.
  2. Produces no side effects.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is Global Scope?

A

Global Scope is anything defined outside of any code block.

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

What is Local Scope?

A

Local Scope is anything defined inside of a code block.

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

Describe map()

A

The map() method creates a new array of results using a function on each element of the array.

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