Awesome post! I have to make the subtle point of the performance difference when you use certain approaches though.
let multipliedByTwo = arr.map((el) => timesTwo(el));
let multipliedByTwo = arr.map((el) => timesTwo);
creates extra unnecessary function around a function. It can be more of a hit when you nest function definitions inside of a callback, but that's a subject for a different post altogether! Great work here!
Absolutely true. And given that I was trying to show identical code I struggled over whether to include that one. Thanks for noting it. I likely should have of the original post!
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.