总结工作中遇到的js方法
substring()
substring(from , to)
substring() 方法用于提取字符串中从from-to的字符串
var str="Hello world!";
document.write(str.substring(3)); //lo world!
document.write(str.substring(3,7)); //lo w
floor()
返回小于等于X的最大整数
var a = Math.floor(1.9) 返回1
var b = Math.floor(0.6) 返回0
var c = Math.floor(-5.9) 返回-6
random()
返回 0(包含) - 1(不包含) 之间的任意数
Math.random() 返回任意 0 - 1 之间的数
Math.floor(Math.random()*100 + 1 ) 返回 0 - 100 任意一整数