CodingTrain / Suggestion-Box

A repo to track ideas for topics
570 stars 86 forks source link

Array Higher Order Functions in JavaScript #515

Open ghost opened 7 years ago

ghost commented 7 years ago

Hello Daniel,

The JavaScript Array prototype provides a number of what are fancily known as higher-order functions. Apart from the usual suspects Array.prototype.map(), Array.prototype.filter() and Array.prototype.reduce(), there are the lesser known Array.prototype.sort(), Array.prototype.some() and Array.prototype.every() higher-order functions, not to mention Array.prototype.forEach() is also one. Having learnt these recently in JavaScript as well as Swift, I find them a very powerful tool to add in the toolbox of a programmer of any skill. They make array operations look significantly more structured in code. However, I do not know how efficient they are, when it comes to how fast one’s code runs.

I am raising this issue to request you to make a video tutorial on these higher-order functions, to reiterate, as knowing and using them are a powerful skill and they make your source code look far more structured and undeniably intuitive.

Sincerely, Prathamesh Kowarkar

RedHenDev commented 7 years ago

I guess the real challenge would be to demonstrate immediate, clear gains for the enthusiastic beginner & intermediate programmer over the array functions McShifty has used so far.

That said -- I'd love this: prototypical inheritance and 'higher order functions' in order to make...something bright and beautiful like....Pacman :)

shiffman commented 6 years ago

Making a list of functions to cover: