As @RobG commented — no, you can't.
You can, however, use the this
keyword inside of functions defined as properties of the object, like so:
o = {
a: { foo: 42 },
b: function () {
return this.a;
}
}
console.log(o.b()); // {foo: 42};
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…