toArray: function() {console.log(this.slice);
return core_slice.call( this );
},
理解上面代码,就要知道jQuery是一个类数组。
类数组:
- 拥有length属性,其它属性(索引)为非负整数(对象中的索引会被当做字符串来处理,这里你可以当做是个非负整数串来理解)
- 不具有数组所具有的方法
具体可参考https://segmentfault.com/a/1190000000415572
toArray: function() {console.log(this.slice);
return core_slice.call( this );
},
理解上面代码,就要知道jQuery是一个类数组。
类数组:
具体可参考https://segmentfault.com/a/1190000000415572
转载于:https://my.oschina.net/simaguo/blog/808620