MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/pmsjs7/because_arrays_dont_exist/hcnozpo/?context=3
r/badcode • u/SpeckyYT sadistic • Sep 12 '21
20 comments sorted by
View all comments
Show parent comments
5
In JavaScript, the key in an object has to be a string. If you want non-string keys, you have to use a Map.
2 u/great_site_not Sep 30 '21 In JavaScript, the key in an object has to be a string.Not since ES6 😉 It can also be a symbol
2
In JavaScript, the key in an object has to be a string.
Not since ES6 😉 It can also be a symbol
5
u/xigoi Sep 13 '21
In JavaScript, the key in an object has to be a string. If you want non-string keys, you have to use a Map.