摘要:
function getArrayRandomVal(arr) { var len = arr.length, index = Math.floor(len * Math.random()); return arr[index]; } 阅读全文
摘要:
var type = (function() { var getType = function(o) { return Object.prototype.toString.call(o) }; return { isNumber: function(o) { return getType(o) === '[object Number]'; }, isBoolean: ... 阅读全文
摘要:
function random(min, max) { return min + Math.floor(Math.random() * (max - min + 1)); } 阅读全文