摘要: 遍历器(Iterator)设计目的: 一是为各种数据结构,提供一个统一的、简便的访问接口 二是使得数据结构的成员能够按某种次序排列 三是 ES6 创造了一种新的遍历命令for...of循环,Iterator 接口主要供for...of消费 实例 Map下的Symbol(Symbol.iterator 阅读全文
posted @ 2019-02-21 17:45 兴趣使然的Geek 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 普通函数 优点:支持流程控制(break、continue、return) for js const arr = ["A","B","C"] arr.map(e = console.log(e)) js const arr = ["A","B","C"] arr.forEach(e = consol 阅读全文
posted @ 2019-02-21 16:54 兴趣使然的Geek 阅读(211) 评论(0) 推荐(0) 编辑