摘要: function getArrayRandomVal(arr) { var len = arr.length, index = Math.floor(len * Math.random()); return arr[index]; } 阅读全文
posted @ 2017-04-27 18:30 ax=null 阅读(294) 评论(0) 推荐(0) 编辑
摘要: var type = (function() { var getType = function(o) { return Object.prototype.toString.call(o) }; return { isNumber: function(o) { return getType(o) === '[object Number]'; }, isBoolean: ... 阅读全文
posted @ 2017-04-27 16:37 ax=null 阅读(655) 评论(0) 推荐(0) 编辑
摘要: function random(min, max) { return min + Math.floor(Math.random() * (max - min + 1)); } 阅读全文
posted @ 2017-04-27 15:36 ax=null 阅读(1116) 评论(0) 推荐(0) 编辑