我一直在查看ECMAScript规范,但无法弄清楚为什么它们的评估结果不同:
1 + {}
{} + 1
({})+1
建议任何试图弄清楚这一点的人阅读:
https://www.ecma-international.org/ecma-262/9.0/index.html#sec-addition-operator-plus
https://www.ecma-international.org/ecma-262/9.0/index.html#sec-ordinarytoprimitive