SvenZhao
11/21/2018 - 9:12 AM

getRandom

getRandom

//获取指定位数的整数随机数
export const getRandom = num => {
  return Math.floor((Math.random() + Math.floor(Math.random() * 9 + 1)) * Math.pow(10, num - 1));
};