Concepts Flashcards

1
Q

What is assign by value vs reference

A

when assigning to a value it can be reassigned however by reference with arrays and objects is simply pointing to a number entry in the stack so you cannot overwrite without using certain methods

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

What is a Higher order component

A

It is a function that takes in a component and returns a component

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

What is callback hell

A

Callback hell refers to the situation where callbacks are nested within other callbacks several levels deep, potentially making it difficult to understand and maintain the code.

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

What is a tick function

A

It returns a promise that resolves as soon as any pending state changes have been applied to the DOM (or immediately, if there are no pending state changes).

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

What is the difference between a pure component and a functional component

A

In a functional component you can use state hooks to pass around data whereas in class you need to use props. In a functional component you can use useEffect for mounting versus having to use multiple mount functions like in class components.

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

What is recursion

A

Recursion is when a function calls itself until someone stops it. It can be used instead of a loop. If no one stops it, it’ll recurse forever and crash your program. A base case is a condition that stops the recursion.

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

What is closure

A

A closure is the combination of a function bundled together (enclosed) with references to its surrounding state (the lexical environment). In other words, a closure gives you access to an outer function’s scope from an inner function.
Closure helps if you want to hide a variable value inside a function and be able to not have to worry about it getting changed globally.

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