When a statement starts with `{`, it is interpreted by the parser as the beginning of a **block** of statements, not an object initializer expression.
– PointyNov 19 '21 at 14:20
See https://felix-kling.de/js-loose-comparison/#%5B%5D==%5B%5D and https://felix-kling.de/js-loose-comparison/#%5B%5D==!%5B%5D . The first case is easy: Two different objects are never equal. The second one is a bit more complex. Check out the links.
– Felix KlingNov 19 '21 at 14:44
1 Answers1
0
It's just a syntactic limitation. ({}) == 1 works just fine.