Please enable JavaScript.
Coggle requires JavaScript to display documents.
JavaScript - Interview - Coggle Diagram
JavaScript - Interview
Functional Programming
-
-
Function composition
The processing of combining two or more functions in order to procedure a new function or perform some computation:
f(g(x));
Avoid Share State
Shared state is any variable, object , or memory space that exist in share scope.
Shared state that mean is sharing effect(a calling to API), shared effect is not good for change the data frequently
-
Avoid mutating state
Use Object.freeze();
const a = Object.freeze({
foo: 'Hello',
bar: 'word'
})
Avoid Side Effect
A side effect is any application state change that is observable outside the called function other than its return value
Modifying any external variable or object property (e.g., a global variable, or a variable in the parent function scope chain)
-
-
-
-
-
-
-
-