Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

精读《迭代器 Iterable》 #448

Closed
ascoders opened this issue Nov 6, 2022 · 4 comments
Closed

精读《迭代器 Iterable》 #448

ascoders opened this issue Nov 6, 2022 · 4 comments

Comments

@ascoders
Copy link
Owner

ascoders commented Nov 6, 2022

本周精读的文章是 IterablesIteration protocols,按照为什么需要迭代器、迭代器是如何设计的,我们还能怎么利用迭代器展开来讲。


精读《迭代器 Iterable》

@ascoders ascoders closed this as completed Nov 7, 2022
@zq0904
Copy link

zq0904 commented Nov 8, 2022

为什么 对象不具备迭代器 仍然可以使用展开运算 不能for of

示例

const obj = {}
const o = { ...obj }

@ascoders
Copy link
Owner Author

ascoders commented Nov 8, 2022

@zq0904 对象不支持 [ ...obj ],这才是迭代器展开。

@KuangDaDa
Copy link

是不是 用 迭代器 实现 async/await 的吗?

@HiWayne
Copy link

HiWayne commented Nov 22, 2022

为什么对象可以支持for in,for in 不算迭代吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants