Skip to content

Instantly share code, notes, and snippets.

@deadcoder0904
Last active January 6, 2017 19:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deadcoder0904/9d4c5305794efd0707a937708893ef15 to your computer and use it in GitHub Desktop.
Save deadcoder0904/9d4c5305794efd0707a937708893ef15 to your computer and use it in GitHub Desktop.
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment