What is functional programming?
We have to remember one keyword – higher-order functions? what are higher-order functions?
arr.filter(function(element) return element > 3;)
arr.map(function(element) return element * 2;)
arr.find(function(element) return element = 10;)
Functions are pure functions. no side-effects. For the same input, you always get the same output. For example, if a function’s output is calculated with Date(), then it is not a pure function. This is because every time you the the function, you will get a different output depending on the current Date and time.