Skip to content

类数组转换

call + slice

js
Array.prototype.slice.call(arrayLike)

apply + concat

js
Array.prototype.concat.apply([], arrayLike)

Array.from

js
Array.from(arrayLike)