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
- Host: GitHub
- URL: https://github.com/edysegura/js-functional
- Owner: edysegura
- License: mit
- Created: 2016-09-11T19:16:21.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2025-04-03T18:41:15.000Z (12 months ago)
- Last Synced: 2025-04-03T19:35:52.916Z (12 months ago)
- Topics: functional-programming, javascript
- Language: JavaScript
- Homepage:
- Size: 50.8 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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)