- Itertator:遍历器(迭代器)
- const it=[1,2]Symbol.iterator;
console.log(it.next()); //{value:1,done:false}
console.log(it.next()) //{value:2,done:false}
console.log(it.next()) //{value:1,done:true} - 什么是Iterator
Symbol.iterator(可遍历对象的生成方法)->it(可遍历对象)->it.next()->it.next()
相关文章
- 12-12284. Peeking Iterator
- 12-12Enumeration接口和Iterator接口的区别
- 12-12PCL代码编译过程中出现error LNK2038: 检测到“_ITERATOR_DEBUG_LEVEL”的不匹配项: 值“0”不匹配值“2” 解决方法
- 12-12模块导入from collections import Iterator,Iterable失败
- 12-12Leetcode: Flatten Nested List Iterator
- 12-12Symbol.Iterator简单理解
- 12-12900. RLE Iterator
- 12-1214 Iterator和for...of循环
- 12-12c++中的迭代器 iterator
- 12-12284. Peeking Iterator 光是看看下一个值的遍历