DEV Community

Discussion on: 10 Clean code examples (Javascript).

Collapse
 
jivkojelev91 profile image
JivkoJelev91

Everything is fine, except 6. There is no need to create a new object, new array, loop over them and so on, this is neither clean, neither fast.

Collapse
 
thefern profile image
Fernando B 🚀 • Edited

Yup he had me sold on most, except 6 and 10. One note on 6 might be a good case, if you're looping through a known array, but for this specific example I don't think is worth the hassle.

Collapse
 
redbossrabbit profile image
Ibeh Ubachukwu

Thanks!. It thought it would be helpful when you have to get alot of elements from the DOM. I guess its more of 'less' code than 'clean' code 😄