Array.from() 能将类数组(arguments,NodeList),可迭代对象(Set,Map),字符串(String)转换成数组
Array.from(arrayLike, mapFn, thisArg) --> Array.from(arrayLike).map(fn(), thisArg)
Array.prototype.slice.call() 能将类数组(arguments,NodeList),字符串(String)转换成数组
Array.prototype.slice.call(arrayLike, index) 从第index个开始转换成数组
网友评论