We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Object.is()
===
==
No description provided.
The text was updated successfully, but these errors were encountered:
以下情况,Object.is认为是相等
两个值都是 undefined 两个值都是 null 两个值都是 true 或者都是 false 两个值是由相同个数的字符按照相同的顺序组成的字符串 两个值指向同一个对象 两个值都是数字并且 都是正零 +0 都是负零 -0 都是 NaN 都是除零和 NaN 外的其它同一个数字
Object.is() 类似于 ===,但是有一些细微差别,如下:
console.log(Object.is(NaN, NaN));//true console.log(NaN === NaN);//false console.log(Object.is(-0, +0)); //false console.log(-0 === +0); //true
Object.is 和 ==差得远了, == 在类型不同时,需要进行类型转换,前文已经详细说明。
Sorry, something went wrong.
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: