js 最短代码生成随机数(字符串、id)

以生成8位字符串为例

Math.random().toString(36).substr(-8)

 

posted @ 2019-09-11 10:13  最好的年纪  阅读(1098)  评论(0编辑  收藏  举报