In this article I have covered everything you need to know about functional programming in JavaScript. Understanding the following features of JavaScript takes your JavaScript level to a higher level and it makes your JavaScript code shorter and cleaner. In addition, you will be able to solve complicated problems in a simpler way using this methods.
- forEach
- map
- filter
- reduce
- find
- findIndex
- some
- every
https://www.linkedin.com/pulse/functional-programming-asabeneh-yetayeh/
Top comments (3)
Good post, but few things to mention
Map does not modify/mutate array, instead it returns a brand new array.
Reduce does not have a default value as 0. If you do not specify anything for second parameter, it will take caller array's first item as initial value[That's why it is recommended to specify a initial value ].
In your find example variable name is a kind of misleading.
By the way thanks for your efforts to make 30DaysOfJs for community, Kudos :)
very interesting, how ever i dont think its everything, does it cover compositions, monads etc.
The most frequent methods which you use either with vanilla JavaScript or React.