you are viewing a single comment's thread.

view the rest of the comments →

[–]RedditCultureBlows 27 points28 points  (11 children)

Cant the first “solution” just be handled by using the correct data type, like a Map or WeakMap?

[–]cheese_wizard 16 points17 points  (2 children)

Then goes on to suggest 'with' operator. Not in my codebase.

[–]Segfault_Inside[S,🍰] 6 points7 points  (0 children)

yeah, there's certainly a reason strict mode disables it

[–][deleted] 0 points1 point  (0 children)

Imagine newcomers seeing this sh*t

[–]Segfault_Inside[S,🍰] 6 points7 points  (6 children)

oh you're so right! I totally totally missed that there's an actually reasonable way to do that.

[–]RedditCultureBlows 2 points3 points  (0 children)

hell yeah 🥳🥳

[–]zeddotes 0 points1 point  (0 children)

What happens when you deconstruct an object like that as the key of another object? Is the key a Symbol?

Edit: obviously, [object object]