So basically: "don't be stupid, use the right tool for the job". Duh... really?!
I have a question - aren't you doing code reviews in your company? Why do you need to write an article just to point out to newbies, that besides Array.map they have to learn what other methods exist and use them properly?
Oh and give a ridiculous example that is accessing a variable outside the function AND the foreach statement, when all you need in this case is Array.reduce:
So basically: "don't be stupid, use the right tool for the job". Duh... really?!
I have a question - aren't you doing code reviews in your company? Why do you need to write an article just to point out to newbies, that besides Array.map they have to learn what other methods exist and use them properly?
Oh and give a ridiculous example that is accessing a variable outside the function AND the foreach statement, when all you need in this case is Array.reduce:
Please take some time to study what other options you have before writing articles.