能夠比較一下兩種方法Array.prototype.concat
和Array.prototype.push
的異同數組
同時斷定是不是數字以及是否有限app
function isArray(obj) { return Object.prototype.toString.call(obj) === '[Object Array]'; }
var number = [5, 457, 120, -215, 333, 555]; var maxInNumber = Math.max.apply(Math, numbers); var minInNumber = Math.min.apply(Math, numbers);
var myArray = [12, 333, 499]; myArray.length = 0;