Object Key Order Playground

Customers’ slips are filed into cabinet o one by one, with number, text and symbol keys: guess the order the engine files the drawers in, then compare a Map…

Why it matters

A subtle bug: an object used as an ordered list with number keys (queue tickets, years, IDs), and the order changes by itself. Knowing the rule, and when to use a Map, prevents a list that jumps around silently.

The key idea

Whole-number keys first, ascending; then text in order of arrival; then symbols

Common mistakes

Try it in this playground