shfshanyue / Daily-Question

互联网大厂内推及大厂面经整理,并且每天一道面试题推送。每天五分钟,半年大厂中
https://q.shanyue.tech
4.92k stars 508 forks source link

【Q648】如何把一个数组 Array 转化为迭代器 Iterable #666

Open shfshanyue opened 3 years ago

shfshanyue commented 3 years ago
const list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

const it = list[Symbol.iterator]()

it.next()