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
等于操作符 ==
在使用等于操作符时,会发生强制类型转换。
严格的等于操作符 ===
typeof null === 'object' typeof undefined === 'undefined'
JavaScript 深入之头疼的类型转换(上)
JavaScript 深入之头疼的类型转换(下)
转字符串
'' + 10 === '10'
转数值
+'10' === 10; // true Number('010') === 10 parseInt('010', 10) === 10 // 用来转换为整数 +'010.2' === 10.2 Number('010.2') === 10.2 parseInt('010.2', 10) === 10
使用一元的加号操作符,可以把字符串转换为数字。
转布尔型
!!'foo'; // true !!''; // false !!'0'; // true !!'1'; // true !!'-1' // true !!{}; // true !!true; // true
The text was updated successfully, but these errors were encountered:
No branches or pull requests
类型比较
比较与相等
等于操作符 ==
在使用等于操作符时,会发生强制类型转换。
严格的等于操作符 ===
typeof操作符
instanceof操作符
类型转换
JavaScript 深入之头疼的类型转换(上)
JavaScript 深入之头疼的类型转换(下)
转字符串
转数值
使用一元的加号操作符,可以把字符串转换为数字。
转布尔型
The text was updated successfully, but these errors were encountered: