这是我的法典:
var Quo = function(string) { //This creates an object with a status property.
this.status = string;
};
Quo.prototype.get_status = function() { //This gives all instances of Quo the get_status method,
//which returns this.status by default, unless another
//instance rewrites the return statement.
return this.status;
};
var myQuo = new Quo("confused"); //the `new` statement creates an instance of Quo().
document.write(myQuo);
当我操作该代码时,结果为<代码>[目标]代码>。 由于get_status()
附于 Quo
prototype,tn t打。 Quo
足以援引该方法? 我在这里错了什么?