An open API service indexing awesome lists of open source software.

https://github.com/edysegura/js-functional

Functional JavaScript programming examples
https://github.com/edysegura/js-functional

functional-programming javascript

Last synced: about 2 months ago
JSON representation

Functional JavaScript programming examples

Awesome Lists containing this project

README

          

# Functional JavaScript programming examples

This is a collection of examples to demonstrate how to take advantage of functional programming style.

## How to run these examples?

First you need to have [Node.js](https://nodejs.org/en/) installed and then navigate to directory of your choice and then run the command below:

`node index.js`

You may consider to use [JS Bin](http://jsbin.com/?js,console) as an alternative!

## Examples

- [Using filter, map and sort together](filter-map-sort/index.js)
- [Reduce to add prices from a collection](sum-with-reduce/index.js)
- [Reduce to group objects](accumulator-with-reduce/index.js)
- [Chainability with reduce](chainability-with-reduce/index.js)
- [Chainability with high order function](chainability-high-order-functions/index.js)
- [FlatMap with stream](flatmap/index.js)

## References

- [Functional programming in JavaScript with MPJ](https://www.youtube.com/playlist?list=PL0zVEGEvSaeEd9hlmCXrk5yUyqUag-n84)
- [Functional programming and JavaScript Arrays](http://zabana.me/notes/functional-programming-and-javascript-arrays.html)
- [How point-free composition will make you a better functional programmer](https://www.freecodecamp.org/news/how-point-free-composition-will-make-you-a-better-functional-programmer-33dcb910303a/)

----
In case you have doubt why I'm not using semicolon is because I got inspiration from these talks:

- [Semicolons cannot save you!](https://www.youtube.com/watch?v=Qlr-FGbhKaI)
- [Are Semicolons Necessary in JavaScript?](https://www.youtube.com/watch?v=gsfbh17Ax9I)