求一个数组中的最大值
Math.max.apply(null,[1,2,3,4])=>Math.max(...[1,2,3])
讲一个数组中的元素全部添加到另一个数组中
let arr=[1,2,3];let arrs=[4,5,6];
arr.push(...arrs)
数组合并
const arr1=[1,2];
const arr2=[3,4];
[...arr1,...arr2]
数组解构
const [one,...two]=[1,2,3,4,5];
one:[1] two:[2,3,4,5]
如果[...two,one] 会报错
将字符串转化为数组
[..."hellow"]=["h","e","l","l","o","w"]