5 ms·
They randomize the hashing to protect against DoS attacks. You have to go to lengths to preserve the order.
by kevin_thibedeau 5y ago
They randomize the hashing to protect against DoS attacks. You have to go to lengths to preserve the order.
- wruza 5y agoIt depends. Bare hash tables are semi-random and get reshuffled at growth points naturally. But I remember reading in some manual that that language reshuffles iteration even for immutable hash tables. Js objects are usually based on "shapes", which do not follow hash table semantics: https://mathiasbynens.be/notes/shapes-ics https://mathiasbynens.be/notes/shapes-ics https://v8.dev/blog/fast-properties https://v8.dev/blog/fast-properties