类数组转成数组对象

 1 var obj = {
 2     0:1,
 3     1:2,
 4     2:3,
 5     length:3
 6 };
 7 function toArray(obj){
 8     return Array.prototype.slice.call(obj);
 9 };
10 
11 console.log(toArray(obj));//[1,2,3]
原文地址:https://www.cnblogs.com/gongshunkai/p/5831456.html