扫码关注官方订阅号
js文档中toString()是用来转换成字符串的
toLocaleString()是用来转成本地字符串的
我通过代码测试都是用来转换成字符串的,这两者之间有什么联系和区别?
我通过下面这两段代码,看不出有什么不同
首先看下MDN 二者参照看下就可以了https://developer.mozilla.org...
https://developer.mozilla.org...
toLocaleString 的描述是这个样子的
Object's toLocaleString returns the result of calling toString(). *
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
首先看下MDN 二者参照看下就可以了
https://developer.mozilla.org...
https://developer.mozilla.org...
toLocaleString 的描述是这个样子的
Object's toLocaleString returns the result of calling toString(). *