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]
类数组转成数组对象
原文:http://www.cnblogs.com/gongshunkai/p/5831456.html