Search posts, tags, users, and pages
Annukul Thakran
Frontend engineer playing with "things"
You must have used map() and forEach() for at least a 100 times but do you know the differences between these two higher order functions of JavaScript? Don't worry I got you covered. First let's talk about higher order functions. Don't go too deep in...
Ayodele Samuel Adebayo
Software Engineer | Open-Source Contributor | Developer Educator
Good and straightforward explanation Annukul Thakran.
I'll also add that the forEach() function returns undefined by default and not chainable by nature i.e forEach().then(=>{}) will return undefined.
forEach()
undefined
forEach().then(=>{})
Thanks a lot for pointing that out. Have a great day man!
Ayodele Samuel Adebayo
Software Engineer | Open-Source Contributor | Developer Educator
Good and straightforward explanation Annukul Thakran.
I'll also add that the
forEach()function returnsundefinedby default and not chainable by nature i.eforEach().then(=>{})will return undefined.