一, 伪数组
1. 具有length属性
2. 按索引方式存储数据
3. 不具有数组的方法, 比如push(),pop()等数组常用的方法
二, 生成伪数组的方法
在js中生成伪数组的方法比较多
1. document.getElementsByTagName和document.childNodes,返回NodeList对象的都是伪数组
2. 上传文件时选择的file对象也是伪数组
3. function的arguments对象
如下图:
一, 伪数组
1. 具有length属性
2. 按索引方式存储数据
3. 不具有数组的方法, 比如push(),pop()等数组常用的方法
二, 生成伪数组的方法
在js中生成伪数组的方法比较多
1. document.getElementsByTagName和document.childNodes,返回NodeList对象的都是伪数组
2. 上传文件时选择的file对象也是伪数组
3. function的arguments对象
如下图: