L.A. based web developer slowly parsing through Stack Overflow. If you like hot web dev tips or stories about being a freelancer, check out my newsletter: https://codenutt.substack.com/p/coming-soon
L.A. based web developer slowly parsing through Stack Overflow. If you like hot web dev tips or stories about being a freelancer, check out my newsletter: https://codenutt.substack.com/p/coming-soon
L.A. based web developer slowly parsing through Stack Overflow. If you like hot web dev tips or stories about being a freelancer, check out my newsletter: https://codenutt.substack.com/p/coming-soon
Full-time web dev; JS lover since 2002; CSS fanatic. #CSSIsAwesome
I try to stay up with new web platform features. Web feature you don't understand? Tell me! I'll write an article!
He/him
Awesome article! Minor nitpick though: Array.prototype.forEach() and its siblings map, filter, reduce, reduceRight, some, and every were all actually introduced back in 2009 with ES5!
I bring this up not for know-it-all points, but because it's important for browser compatibility. Most of these methods are available in browser versions going back 10+ years, which is super important and helpful if, like me, you work in an environment where you still need to maintain support for those browsers π
L.A. based web developer slowly parsing through Stack Overflow. If you like hot web dev tips or stories about being a freelancer, check out my newsletter: https://codenutt.substack.com/p/coming-soon
L.A. based web developer slowly parsing through Stack Overflow. If you like hot web dev tips or stories about being a freelancer, check out my newsletter: https://codenutt.substack.com/p/coming-soon
You can use .every() instead and return false whenever you want to
break. Return true to keep goingInteresting! Thank you for your insight. I haven't used
everymuch. Very handy!.some()is probably even better in most cases. Just return true whenever you need tobreak. No need to return anything when you want to keep going :)Sweet! May have to do a deep dive article into all the various loop types.
This is so helpful
Thanks! Any other topics you'd like me to tackle?
Awesome article! Minor nitpick though:
Array.prototype.forEach()and its siblingsmap,filter,reduce,reduceRight,some, andeverywere all actually introduced back in 2009 with ES5!I bring this up not for know-it-all points, but because it's important for browser compatibility. Most of these methods are available in browser versions going back 10+ years, which is super important and helpful if, like me, you work in an environment where you still need to maintain support for those browsers π
Thank you for the correction! I'm the only one who edits these things, so I appreciate any and all feedback. I'll update it to reflect accurate info!
I feel you though, I have to support old browser's too
I always remember that forEach() loop can't be break but i never know why, until now haha. Great article, thanks!
Thanks!
But why they keep all these different versions of doing the same things? That is, forEach(), every() and some().
I mean, you can if you really want: just throw sg from the callback.