摘要:
/*Apply 方法的妙用*//*1.数组最大值*/console.log(Math.max(19, 2, 25, 16, 78));//78/*如果参数是一个一维数组*/var arr = [19, 2, 25, 16, 78];console.log(Math.max(arr));//NaNconsole.log(Math.max.apply(null, arr));//78/*多维数组可以这么修改:*/var a = [1, 2, 3, [5, 6], [1, 4, 8]];/*转化为一维数组*/var ta = a.join(",").split(",&q 阅读全文