问题描述
我做这项研究谷歌浏览器的调试器,来这里的困难的部分。
I am doing this research in Google Chrome's debugger and here comes the hard part.
我得到的事实,我无法删除局部变量(因为它们没有对象属性)。我得到的,我可以读出所有传递给函数从所谓的论据阵列的参数。我甚至得到它,我不能删除和数组的元素,只有实现有 数组[0]
有undefined值。
I get the fact that I can't delete local variables (since they are not object attributes). I get that I can 'read out' all of the parameters passed to a function from the array called 'arguments'. I even get it that I can't delete and array's element, only achieve to have array[0]
have a value of undefined.
谁能向我解释什么 未定义×1
嵌入式图像上意味着什么?
Can somebody explain to me what undefined x 1
means on the embedded image?
而当我重写功能的 富
返回 参数[0]
,然后我得到的通常和正常的定义。
And when I overwrite the function foo
to return the arguments[0]
, then I get the usual and 'normal' undefined.
这只是一个实验,但似乎interresting,有谁知道什么 未定义×1
指的是?
This is only an experiment, but seems interresting, does anybody know what undefined x 1
refers to?
推荐答案
这似乎是Chrome的数组中显示初始化索引的新方法(和的阵列状的对象):
That seems to be Chrome's new way of displaying uninitialized indexes in arrays (and array-like objects):
> Array(100)
[undefined × 100]
这肯定比打印 [不确定的,不确定的,不确定的,...]
或不过以前。
虽然,如果只有一个未定义
价值,他们可以删除×1
。
Although, if there is only one undefined
value, they could drop the x 1
.
这篇关于什么是"未定义×1"在JavaScript中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!