Functional Programming
Pure FunctionsA pure function is a function which: 1. Given the same input, returns the same output. 2. Has no side-effects Benefits of Functional Programming
|
Arrow functions
Currying
Currying is a transformation of functions that translates a function from callable as f(a, b, c) into callable as f(a)(b)(c). |
Array methods
You can shorten and simplify your code with the Array methods! Higher-Order functions
In FP, an important concept is Higher-order functions. It's a function that accepts (what's typically called) a callback function. In JS you can benefit by using libraries like Ramda or lodash/f. Function Composition
Function Composition is an act of composing/creating functions that allow you to further simplify and compress your functions by taking functions as an argument and return an output. It may also return another function as its output other than numerical/string values. |
Cheatography
https://cheatography.com
Functional Programming in JavaScript Cheat Sheet Cheat Sheet by ck0d3r
This is a cheat sheet describing the basics of FP in JS
Created By
Metadata
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets