We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
消耗时间几乎一致(差异可以忽略不计)
JavaScript
索引
属性
1
10万
The text was updated successfully, but these errors were encountered:
No branches or pull requests
结论
消耗时间几乎一致(差异可以忽略不计)
原因
JavaScript
中没有真正的数组, 所有的数组其实都是对象, 其索引
看起来是数字,其实会被转换成字符串, 作为属性
名(对象的key)来使用, 所以无论是取第1
个还是取第10万
个, 都是使用key精确查找哈比表的过程, 消耗时间大致相同.The text was updated successfully, but these errors were encountered: