DEV Community

Discussion on: Enhance your JS Skill by using the correct array method

Collapse
 
codeoz profile image
Code Oz

Hey thanks for comment, in fact you but it's really not adice to not init your accumulator value!

I edtied the post about this fact thanks!

Collapse
 
jonrandy profile image
Jon Randy 🎖️

The ability to have the accumulator automatically initiated like this is a part of JS and allows for more efficient code. Telling people not to use it is bad advice. The same advice applies as per my other comment - how do you expect developers to improve at JS if there is an insistence on treating them as children who will not understand more than basic code. 'Readable' code is subjective, and should not come at the price of less efficient code, and the misleading of people who are learning.