Array.of()
将参数中所有的值做为元素形成数组
console.log(Array.of(1,0,3,7));
console.log(Array.of(1,'2',true));
//参数值可以为不同类型
console.log(Array.of());
//参数为空返回空数组
Array.from()
将数组对象或可迭代对象转化为数组
console.log(Array.from([1,3]));
//参数为数组,返回与原数组一样的数组
console.log(Array.from([2,,3]));
//参数可以含有空位
参数
Array.from(arrayLike[,mapFn[,thisArg]])
//返回值为转换后的数组
arrayLike
想要转换的类数组对象或可迭代对象
console.log(Array.from([1,9,0]));