将类数组对象转换成数组

index.js

const arrayLikeObj = { 0: 1, length: 2 };
[].slice.apply(arrayLikeObj); // [1, empty]
Array.prototype.slice.apply(arrayLikeObj); // [1, empty]
原文地址:https://www.cnblogs.com/aisowe/p/15250189.html