js随机点菜

var dish = ['鱼香肉丝','北京烤鸭','麻婆豆腐','酸辣土豆丝','回锅肉','煎饼卷大葱'];
var num = Math.floor(Math.random()*(y+1-x)+x);

此处案例就是

var num = Math.floor(Math.random()*(5+1-0)+0);

posted on 2017-04-25 09:57  酷克1990  阅读(199)  评论(0)    收藏  举报