引用类型-Math对象Math.min( )、Math.max( )、Math.ceil( )、Math.floor( )、Math.round( )、Math.random( )、Math.abs( )-randomNum传入最小数和最大数可返回随机数,chouqu定义数组,调用randomNum可以返回随机数组项function randomNum(min,max){ var maybe = max - min; return Math.floor(Math.random()*maybe) + min;}//从中抽取一个幸运项;var chouqu = [‘水杯’,‘茶杯’,‘电脑’,‘电源线’,‘数据线’,‘华为9X’,‘恒大冰泉’,‘卫生纸’];var chouquNum = chouqu[randomNum(0,chouqu.length-1)];console.log(chouquNum);-20190306面向对象-理解对象