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 遍历顺序 #52

Open
lovelmh13 opened this issue Apr 18, 2021 · 0 comments
Open

for in 遍历顺序 #52

lovelmh13 opened this issue Apr 18, 2021 · 0 comments

Comments

@lovelmh13
Copy link
Owner

如果对象的 key 是整数属性,则按照整数属性 key 的升序遍历。剩下的属性按照创建顺序遍历。

*整数属性:String(Math.trunc(Number(prop)) === prop 为 true 时,是整数属性

image

JavaScript 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

1 participant