Concepts Flashcards
What is assign by value vs reference
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
What is a Higher order component
It is a function that takes in a component and returns a component
What is callback hell
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.
What is a tick function
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).
What is the difference between a pure component and a functional component
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.
What is recursion
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.
What is closure
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.