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
undefined
Array(1) // [empty] new Array(1) // [empty]
Number
Array(1, 2, 3) // [1, 2, 3] new Array(1, 2, 3) // [1, 2, 3]
this
false
true
Array()
Array(1) // [empty] Array.of(1) // [1]
来自高级前端面试第18题
数组里面有10万个数据,取第一个元素和第10万个元素的时间相差多少?
这个其实涉及到数据结构知识了。数组是索引集合,取第一个和第10万个所用时间应该是一样的,不管取哪个索引的元素时间复杂度都是O(1),时间差应该是0.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
数组对象
数组构造器
Array ( )
undefined
,定义 newTarget 为 活跃的函数对象;否则,定义 newTarget 为 NewTargetArray ( len )
undefined
,定义 newTarget 为 活跃的函数对象;否则,定义 newTarget 为 NewTargetNumber
类型,Array ( ...items )
undefined
,定义 newTarget 为 活跃的函数对象;否则,定义 newTarget 为 NewTargetArray 构造器上的属性
Array.from ( items [ , mapfn [ , thisArg ] ] )
this
值undefined
,定义 mapping 为false
true
undefined
,false
,true
,true
Array.isArray ( arg )
Array.of ( ...items )
Array()
生成数组的不足this
值Array 迭代对象(自己看看就好)
2020-07-29 补充
来自高级前端面试第18题
数组里面有10万个数据,取第一个元素和第10万个元素的时间相差多少?
这个其实涉及到数据结构知识了。数组是索引集合,取第一个和第10万个所用时间应该是一样的,不管取哪个索引的元素时间复杂度都是O(1),时间差应该是0.
The text was updated successfully, but these errors were encountered: