DEV Community

Discussion on: The weird quirk of JavaScript arrays (that you should never use)

Collapse
 
jonrandy profile image
Jon Randy 🎖️

There is a bizarre mindset around that says we shouldn't take advantage of more exotic features of a language because it won't be understood by some developers. If you follow that through to its logical conclusion, then we shouldn't write any code at all, and never advance our knowledge of a language and how it works.

I've never actually done it on an individual array, but I certainly wouldn't rule out doing it.

Thread Thread
 
brewinstallbuzzwords profile image
Adam Davis

Bizarre or pragmatic? If you work in an organization where you're regularly making changes to code written by others, you need to be able to quickly and easily understand that code. Using tools that are appropriate for the situation goes a long way in making your code readable and maintainable.

I would need a strong justification to accept a code review where someone started adding named properties to arrays.

And please refrain from completely mischaracterizing my point. Obviously I'm not saying you shouldn't write code or learn things.