冉冉说
我把{}+{}生成了AST结果如下{ "type": "Program", "start": 0, "end": 5, "body": [ { "type": "BlockStatement", "start": 0, "end": 2, "body": [] }, { "type": "ExpressionStatement", "start": 2, "end": 5, "expression": { "type": "UnaryExpression", "start": 2, "end": 5, "operator": "+", "prefix": true, "argument": { "type": "ObjectExpression", "start": 3, "end": 5, "properties": [] } } } ], "sourceType": "module"}从AST可以看出,第一个{}还是被转化为代码块,+为一元运算符,然鹅在chrome的表现中确实是被当做算术运算符处理"[object Object][object Object]",这或许是chrome的特性(胡扯的,我并不知道为什么),在firefox中结果仍然为NaN。