Please enable JavaScript.
Coggle requires JavaScript to display documents.
Function - Coggle Diagram
Function
Theory
currying function
taking a function with multiple arguments and turning it into a sequence of functions each with only a single argument.
-
-
benefit
-
callbacks are used in a way make sure that certain code doesn’t execute until the other code finishes execution.
-
-
-
Callback function
-
callback hell
anti-pattern with multiple nested callbacks which makes code hard to read and debug when dealing with asynchronous logic
-
Function Declaration
-
-
In strict mode: when a Function Declaration is within a code block, it’s visible everywhere inside that block. But not outside of it.
Interaction
-
prompt
-
they can cancel the input by pressing Cancel or hitting the Esc key, then we get null as the result.
-
IIFE
-
-
obtain data privacy because any variables declared within the IIFE cannot be accessed by the outside world
-
isFinite
determine whether a number is a finite, legal number
returns false if the value is +infinity, -infinity, or NaN (Not-a-Number), otherwise it returns true.
rest parameter
an improved way to handle function parameters which allows us to represent an indefinite number of arguments as an array
-
-
-
Call Stack
define
a mechanism for an interpreter to keep track of its place in a script that calls multiple functions — what function is currently being run and what functions are called from within that function, etc.
-
-
-
-