I actually kind of like this because I always manage a typo when I type 'console.log'. I get a lot of 'cosnole.log'. I think I'm much more consistent typing 'print'.
It's not a matter of milliseconds it's that it's an entire magnitude slower. Sure if you're just doing a single foreach loop then it is what it is. But if you're doing a "common pattern" of filter -> map I've seen all over code bases. And then you do that in 10 different places on a front-end application, all at page load time. All of a sudden you've added an entire second to time-to-interactive.
I get the whole maintainability thing. And there are plenty of places that it ends up being much cleaner and easier to maintain using map/filter/reduce/foreach. And in some places you can add functionality with callback chains or async-await.
But it's something to be aware of that I've seen many more developers just use Array functions as the "default" without thinking.
22
u/BloodAndTsundere Dec 16 '18
I actually kind of like this because I always manage a typo when I type 'console.log'. I get a lot of 'cosnole.log'. I think I'm much more consistent typing 'print'.