3 ms·
Template strings, arrow functions and object shorthand ({ foo: foo } === { foo }) are very nice.
by rhinoceraptor 11y ago
Template strings, arrow functions and object shorthand ({ foo: foo } === { foo }) are very nice.
- tlrobinson 11y agoTo be clear, that statement doesn't actually evaluate to true, but those two object literals are equivalent (not referentially equal)
- tlrobinson 11y agoWhy did someone downvote this? It's correct: https://babeljs.io/repl/#?experimental=true&evaluate=true&loose=false&spec=false&playground=false&code=let%20foo%20%3D%201%3B%0Aalert(%7B%20foo%3A%20foo%20%7D%20%3D%3D%3D%20%7B%20foo%20%7D) https://babeljs.io/repl/#?experimental=true&evaluate=true&lo...