Skip to content

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

@gogoend

Description

@gogoend

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

for-in

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

for-of

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions