为了弄清楚Javascript原型链中的this指向问题,我写了个代码来测试: var d = { d: 40 }; var a = { x: 10, calculate: function (z) { return this.x + this.y + z + this.d }, __proto__:d }; var b = { y: 20, __proto__: a }; var c = { y: 30, __proto__: a }; 运行如下的代码进行测试: console.log(b.c…