Closed bhaskarmelkani closed 7 years ago
However, watch the performance: https://jsperf.com/object-create-null-vs-literal/27
Using ES6's Map
might be even more performant.
This should be merged. It's a good tip. :shipit:
Any update on this ?
@loverajoel ?
Snooze :)
why does the example use let
? there's no reassignment, const
feels more appropriate.
a shout out to there's a shout at the very end, to Map and friends. Map
seems relevant here too.
Guys can we merge this? @loverajoel, @sjfkai, @neighborhood999, @aschelstraete
Looks good to me 👍
let
isn't used anymore :+1:
oh, maybe you meant let
is less confusing? could be, not sure. probably doesn't matter much.
i think eventually, as browsers support 'const' and 'let' natively, optimisations might be applied if it is known a "variable" cannot be reassigned. so probably a good practice to not ask for reassignment if it is not needed.
@r-obert Thanks for your explaining!
Guys: I don't know exactly how the merge must be done, we should move ahead without Joel if he's not available.
I guess its not a big topic to discuss, so we should close(merge/not merge) and move forward. :)
:shipit: ⏲
First time I merge a tip. Hopefully all goes well :)
Some issues. Correcting them now.
Success.
👍
Hash maps with no side effects
TL;DR;
Create hash maps(without side effects) using
Object.create(null)
Username
@bhaskarmelkani
Extra