@mathias I’ve read through some of the V8 articles, but can’t find a definitive answer: is it a bad idea to add a property to an Array: arr.isSomething = true? Mixing properties and elements when iterating the array is in the hot path? Better to make a Class with array as prop?
If you mostly need (non-array-index) keyed access, and only need indexed access a few times, consider using a Map.
In general, you should just do whatever you think makes the most sense. 
-
-
Array it is. Thank you, wise sensei!
-
Putting named properties onto arrays is fine.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.