I get that JavaScript array's... aren't. They aren't arrays, like all variables they're objects, specifically a pointer driven list... but what I don't get is why anyone would use for..in on them in the first place since that's specifically "for" objects.

That said given that the only iterables on an array are the values, I'm not sure where/why you'd assign Array.prototype directly, instead of using Object.defineProperty where iterable can be set/unset.

But then what do I know? I consider arrow functions aggravatingly cryptic trash, "let" to be pointless overhead wasting rubbish, etc, etc... Could be worse though, you could have gone full Gungan and used bloated slow trash like map or filter.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store