Re:JavaScript Algorithms and Data Structures (2018)
by oweiler on Friday October 22, 2021 @02:40PM
(#28960888)
That would be JavaScripts native Map, no?
[ Parent
| on HN ]
Re:JavaScript Algorithms and Data Structures (2018)
by wffurr on Friday October 22, 2021 @03:10PM
(#28961326)
TIL ES6 Map is guaranteed to iterate in insertion order. That always made me crazy in C++ too; the structure that I usually actually want is std::unordered_map not std::map.
There are other algorithms and use cases for a stable iteration into an ordered sequence, but I can’t think of any off-hand. It is true that it’s rare to prefer a linked list on modern CPU architecture.