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
underscore源码翻译版本中,224行翻译说javascript中数组的最大长度为Math.pow(2,53)-1,但是我在控制台上测试过,出现异常 在ECMA262标准中,length的最大长度应该为 Math.pow(2,32)-1 参考链接
The text was updated successfully, but these errors were encountered:
的确,你是对的。这点我也不大理解,源码给了个链接 http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength,你可以看下有没有用?(我是没大看明白)
Sorry, something went wrong.
underscore 这里不是判断array,更多是对array-like(类数组?)对象的判断。因此,数组的最大长度依然是 Math.pow(2,32)-1, 而这里的 Math.pow(2,53)-1是针对其他array like对象的。另外这里的Math.pow(2,53)-1 严格来说也不是array like 对象的最大长度值,而是一个“最安全整数” (MAX_SAFE_INTEGER )https://tc39.github.io/ecma262/#sec-number.max_safe_integer
@HangYang 棒!感谢指出 到时说到这一部分的时候再重点讲下 再次感谢!
No branches or pull requests
underscore源码翻译版本中,224行翻译说javascript中数组的最大长度为Math.pow(2,53)-1,但是我在控制台上测试过,出现异常
在ECMA262标准中,length的最大长度应该为 Math.pow(2,32)-1
参考链接
The text was updated successfully, but these errors were encountered: