deadcoder0904
1/6/2017 - 5:01 PM

Functional Light JS Notes

Functional Light JS Notes

Functional Light JS Notes

(1) Morphism - A fancy way of describing a set of values that maps to another set of values

(2) Function vs Procedure -Functions take input & return some ouptut; Procedures need not return

(3) Arity - Arity is the number of parameters in a function declaration.

(4) Unary Function - A function with arity of 1 is also referred to as a unary function.

(5) Variadic Function - A function signature that accepts an indeterminate amount of arguments is referred to as a variadic function.

(6) Ad Hoc Polymorphism - Overloading a function with lots of behaviors based on its inputs is called ad hoc polymorphism.

(7) Higher Order Function - A function that receives or returns one or more other function values has the special name: higher-order function.

(8) Pure Function - Funtions which always return the same output when entered the same input. They are immutable.

(9) Side Effects - Functions which are not pure have Side Effects. They are mutable.

(10) Closure - Closure is when a function remembers and accesses variables from outside of its own scope, even when that function is executed in a different scope. When the inner function makes reference to a variable from the outer function, then it is called closure.

(11) Currying - Function that expects multiple arguments is broken down into successive chained functions that each take a single argument (arity: 1) and return another function to accept the next argument. This technique is called currying.