Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
temporarysdwvit
· 6y ago · 0 comments
Oh you can, just implement toString and js will use it for hashing
Comments
[–]
IshKebab
6y ago
No it won't.
[–]
yqot
6y ago
Map, no. Plain object, yes.
[–]
IshKebab
6y ago
It doesn't "use `toString` for hashing", it just converts the key to a string. That is not the same (e.g. you can't recover the original key).