Functional Programming
Principles
Pure functions
//Side effects:
const array = [1,2,3];
function mutateArray(arr) {
arr.pop()
}
function mutateArray2(arr) {
arr.forEach(item => arr.push(1
))
}
//The order of the function calls will matter.
mutateArray(array)
mutateArray2(array)
arrayCache in memory
Currying and Composing
pipe() and compose()
Last updated