在下面的代碼中,x成員是否可以從嵌套對象字面值進行訪問?如何從嵌套對象文字訪問外部成員?
var outer = {
x : 0,
inner: {
a : x + 1, // 'x' is undefined.
b : outer.x + 1, // 'outer' is undefined.
c : this.x + 1 // This doesn't produce an error,
} // but outer.inner.c is NaN.
}
Int eresting。不知道它是否可以。 –