As object oriented programming starts to fall out of favor with developers, functional programming is making a comeback. Reasons such as side effects and unit testability are hastening it. The Telerik developer blog has a great post up detailing functional programming with arrays.
They have examples of map
, filter
, and of the lesser known reduce
. There is even a pretty easy to understand example of currying in javascript. All in all, if you are new to javascript or coming up to the newer syntax, this post is a great teaching tool. And honestly it is also a great reference to keep when you have that mid-day coding session brain fart.
Telerik blog: https://www.telerik.com/blogs/functional-programming-with-javascript-object-arrays