function toString(); 返回string。
function Point() {
this.x = 0;
this.y = 0;
this.toString = function () {
return "Point[x=" + this.x + ",y=" + this.y + "]";
}
}
function foo(point) {
point.x = 1;
point.y = 2;
}
var point = new Point();
foo(point);
console.log("" + point); // Point[x=1,y=2]