Please enable JavaScript.
Coggle requires JavaScript to display documents.
JS Study (Functions (Higher Order Function (Reduce (computing a single…
JS Study
Functions
Lexical Scope
-
Let keyword in es2015 fix this creating a variable that is local to the enclosing block not to the enclosing
function
-
-
-
se refere à forma como funções definidas dentro de um "lexical scope" (i.e. o corpo de uma função, um bloco, um arquivo fonte) acessam variáveis definidas nesse contexto.
-
Este ambiente consiste de quaisquer variáveis que estavam no escopo naquele momento em que a função foi criada
-
is a mechanism for an interpreter (like the JavaScript interpreter in a web browser) to keep track of its place in a script that calls multiple functions
-
-
-
1 - script calls function, interpreter adds it to the call stack and then starts carrying out the function
2 - functions that are called by that function are added to the call stack further up, and run where their calls are reached
3 - When the main function is finished, the interpreter takes it off the stack and resumes execution it left off in the main code listing.
4 - If the stack takes up more space than it had assigned to it, it results in a "stack overflow" error.
-
-
-
-
-
-
we could talk about problems in a higher, more abstract level
-
-
-
Map
-
-
New array will have the same length as the input array but its content will have been "mapped" to a new form
Reduce
-
-
-
reduce (array, combine_function, start_element)- last argument optional if array > 1
-