更新时间:2023-09-21 22:48:40
这是因为在第二种情况下,{}
被解释为代码块,而不是对象.
That's because in the second case, {}
is interpreted as a code block, rather than an object.
如果您尝试({}) == []
,则效果很好.
If you try ({}) == []
it works just fine.
js> ({}) == []
false
js> ({}) === []
false