Section 6: Async Foundations Flashcards

1
Q

Define a “Callback Function”

A

A function that is passed into another function as a parameter, then invoked by that other function.

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

Name the parameters of the ‘forEach’ method

A

forEach(array, callback)

someArray.forEach(function(element, index, array) {
console.log(item);
});

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

Name the parameters of the callback function inside the forEach method.

A

someArray.forEach(function(element, index, array) {
console.log(element);
});

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

What does the the ‘findIndex’ method do?

A

It returns the index of the first element in the array for which the callback returns a truthy value. ‘-1’ is returned if the callback never returns a truthy value.

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

Define how ‘the Stack’ is set up and how it works.

A
  • An ordered set of stack frames
  • Most recently invoked function is on the top of the stack
  • The bottom of the stack is the first function invoked
  • The stack is processed from top to bottom.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Define ‘the Heap’

A
  • An area in memory where your data is stored
How well did you know this?
1
Not at all
2
3
4
5
Perfectly