Closed dhollinden closed 6 years ago
I tripped up on this as well, and @marijnh already made some changes to the text. But I might suggest this for further clarification:
Because property names must be strings, this still doesn’t help when your key values are of some other type.
But this solution doesn't address another constraint of using plain objects as maps – that object property names must be strings. If you'd like your key values to be of a different type, this approach will not work.
Or something like that. I think the confusion is that the current verbiage makes it feel too closely linked to the previous paragraph, when it's somewhat of a different issue. I could be wrong. Feel free to ignore :)
I hope attached patch helps with the string-key paragraph.
That does help. Thanks!
I'm not able to understand what this is implying:
"However, because property names are strings, this still doesn’t help when your key values are of some other type."
For me, and possibly other newbie readers, it'd be helpful to have an example that illustrates the problem.
Thanks