js积累
长耳朵的鱼鱼
这个作者很懒,什么都没留下…
展开
-
ES6对象中实现Symbol.iterator接口
可以实现自定义规则的对对象内部数据的遍历 var people={ name:'test', sex:'male', hobbies:['ball','paint','sing'], [Symbol.iterator](){ const _this=this; let index=0; return { next(){ if(index<_this.hobbies.l原创 2020-07-28 15:10:31 · 352 阅读 · 0 评论 -
立即执行函数的写法
console.log("hello word!"); })(); (function foo() { console.log("hello word!"); }());原创 2020-06-29 17:29:20 · 122 阅读 · 0 评论