类数组
类数组不是数组,但是长得像数组,他没有数组的那些方法
函数的argumets就是一个类数组
类数组的产生:
var obj = {
'1' : 'a',
'2' : 'b',
'3' : 'c',
'length' : 3,
'push' : Array.prototype.push
}
// Array.prototype.push = function(target){
// obj[obj.this] = target;
// obj.length ++
// }
//这是系统push的过程
}
//首先,对象的属性必须是索引位(数字),
//然后,必须有length值,然后可以将数组的方法放在对象里面,这样的话对象可以当数组使用,也可以当对象使用