3 ms·
But the point is that it's always usage dependant. You key by color names, that seems obvious. But what if you want to look up a color by hex? Now you have to
by SamBam 6y ago
But the point is that it's always usage dependant.
You key by color names, that seems obvious. But what if you want to look up a color by hex? Now you have to look through them all.
What if this list is actually an order list of colors for different headings? And they can repeat? Then indexing by index is exactly what you want.
Point is, you don't know the reason behind the data structure.
(That said, I do wish the json had a standardized way to remove redundancy for objects that always follow the same structure. One list of property names, and then everything in arrays.)
- falcolas 6y ago> But what if you want to look up a color by hex? Now you have to look through them all. As you would with the original one as well. > Then indexing by index is exactly what you want. A much better use case. That said, the list order is kinda fragile, having an explicit row identifier might be worth adding. Especially since all of the columns are being explicitly called out instead of in their own list.