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

for-in 与 for-of 有何区别? #63

Open
gogoend opened this issue Oct 12, 2020 · 0 comments
Open

for-in 与 for-of 有何区别? #63

gogoend opened this issue Oct 12, 2020 · 0 comments
Labels
5% 写作进度 5% es TODO

Comments

@gogoend
Copy link
Owner

gogoend commented Oct 12, 2020

整理自:
https://www.zhangxinxu.com/wordpress/2018/08/for-in-es6-for-of/

for-in

可以枚举对象,包括对象原型链上可枚举的属性与方法

for-of

可以遍历包含迭代器的对象 —— 字符串、数组、类数组、Map、Set、Generator

@gogoend gogoend added es TODO 5% 写作进度 5% labels Oct 12, 2020
@gogoend gogoend changed the title 来干一仗 —— for-in 与 for-of for-in 与 for-of 有何区别? Oct 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5% 写作进度 5% es TODO
Projects
None yet
Development

No branches or pull requests

1 participant