Please enable JavaScript.
Coggle requires JavaScript to display documents.
JS- Function (Defining a function (is just a regular variable definition…
JS- Function
Defining a function
is just a regular variable definition where the value given to the variable happens to be a function.
-
-
-
-
-
The Call Stack
-
When the function returns, it removes the top context from the stack and uses it to continue excecution
Storing stack require space in the computer's memory. When the stack grows too big, the computer will fail ( out of stack space or too much recursion)
-
Recursive
-
-
Sometime, the problems are much easier to solve with recursion than with loops
Closure
-
The local variables really are re-created for every call, different calls can't trample on one another's local variables