var p = {// x and y are regular read-write data properties.x: 1.0,y: 1.0,r:function () { return Math.sqrt( x*x + y*y); },
};
如果调用 p.r(),会报错的, r函数里面必须要用 this来引用 x和y。你悟到了什么呢?