随机数Math.random()

document.write(parseInt(Math.random()*39))

 

//输出39随机数 可获取0到38的随机整数。

 

因为是从0开始为一个数

0到38 就有  39个数