js 获取n位随机数

1、n位Number类型的随机数  javascript function randomn(n) { if (n > 21) return null return parseInt((Math.random() + 1) * Math.pow(10,n-1)) } 2、n位String类型的数字随机数java // RegExp(pattern, attributes)attributes
相关文章
相关标签/搜索