好像之前用toString时都是用于返回对象的转字符串比较多,看到了别人写的这行代码,然后查阅了下,发现了其可以和Number基于toString的radix 参数使用。radix的范围为[2,36](默认为10),通过控制台可以知道

Math.random().toString(36)使用
发现生成的是随机16/17位小数?
Math.random().toString(36)使用
通过toString(36)后发现小数点后的数字转为0·9a·z的值
Math.random().toString(36)使用
能取出 小数点后的字符串

相关文章:

  • 2021-09-18
  • 2022-12-23
  • 2022-03-09
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
  • 2021-11-30
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案