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
Number({}) // NaN 等同于Number("[object Object]")
因为你传参是一个对象,它属于复合数据类型,会隐式调用valueOf方法。 1.隐式转换过程中,valueOf如果能返回基本数据类型则不会往下计算; 2.valueOf如果不能返回基本数据类型则会继续调用toString方法,toString方法如果还不能自动转换为基本数据类型则报错!
从++[[]][+[]]+[+[]]==10?深入浅出弱类型JS的隐式转换
The text was updated successfully, but these errors were encountered:
(1314).toString(16) // ‘522’ parseInt('522', 16) // 1314
Sorry, something went wrong.
No branches or pull requests
从++[[]][+[]]+[+[]]==10?深入浅出弱类型JS的隐式转换
The text was updated successfully, but these errors were encountered: