这一个题目,
{}+'a' < {} +'b';
+ 的用法
If Type(lprim) is String or Type(rprim) is String, then
a.
Return the String that is the result of concatenating ToString(lprim) followed by ToString(rprim)
因为 rprim='a' 是字符串, 所以
{}+'a' = ToString({}) + 'a'= "[object Object]a"
{} +'b' = "[object Object]b"
因此 {}+'a'<{}+'b' 为true ;
至于你说的 {}+'a' 的值为 NaN 。。 我觉得是不是被 chrome 的 console 误导了?

{}+'a' < {} +'b';
+ 的用法
If Type(lprim) is String or Type(rprim) is String, then
a.
Return the String that is the result of concatenating ToString(lprim) followed by ToString(rprim)
因为 rprim='a' 是字符串, 所以
{}+'a' = ToString({}) + 'a'= "[object Object]a"
{} +'b' = "[object Object]b"
因此 {}+'a'<{}+'b' 为true ;
至于你说的 {}+'a' 的值为 NaN 。。 我觉得是不是被 chrome 的 console 误导了?









