Functional Programming
··1 min
Table of Contents
Go To References #
- GeeksforGeeks - Functional Programming Paradigm - Overview of the mathematical basis of functional programming, the Lambda Calculus, and five key concepts:
- Pure functions: always obtain the same output for the same inputs without any side effects
- Recursion: use of recursive definitions with a base case instead of
for
orwhile
loops - Referential transparency: no reuse of variables
- Functions are First-Class / Higher-Order: can pass functions into other functions as parameters
- Variables are Immutable: no changing of variables
Videos #
- Coding Tech - Functional Programming Basics In ES6 - Nice demonstration of functional programming concepts bulit into Javascript:
let
vsconst
for variable immutability- arrow function syntax
- variable number of arguments, destructuring, and default parameter values
- object merging with
Object.assign()
- making arrays immutable with
Object.freeze()