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
定义的位置不同
String 是 javascript的全局函数 toString() 是 Object 原型的一个方法
Sting()可以完成对 null 和 undefined 的转换
String() 可以将 null, undefined 转化为字符串;而 toString()不可以。
不同进制之间的转换
String()只支持转为普通字符串,不支持转为相应进制的字符串;
而Number.toString(radix)可以将一个Number对象转换对应进制的字符串;其中radix可选,表示数字几基数。
参考
The text was updated successfully, but these errors were encountered:
No branches or pull requests
String 和 toString 的区别
定义的位置不同
String 是 javascript的全局函数
toString() 是 Object 原型的一个方法
Sting()可以完成对 null 和 undefined 的转换
String() 可以将 null, undefined 转化为字符串;而 toString()不可以。
不同进制之间的转换
String()只支持转为普通字符串,不支持转为相应进制的字符串;
而Number.toString(radix)可以将一个Number对象转换对应进制的字符串;其中radix可选,表示数字几基数。
参考
The text was updated successfully, but these errors were encountered: