ncaught TypeError: Cannot read property '0' of undefined
function random(range)
{
//支持负数范围
var max = Math.max(range[0],range[1]);
var min = Math.min(range[0],range[1]);
var diff = max - min;
var number = Math.ceil((Math.random() * diff + min));
return number;
}