为什么输出this.x跟this.y是undefine?
var starObj = function() {this.x;this.y;}
starObj.prototype.init = function() {this.x = 300;this.y = 400;}
starObj.prototype.draw = function() {
console.log(this.x);}
var starObj = function() {this.x;this.y;}
starObj.prototype.init = function() {this.x = 300;this.y = 400;}
starObj.prototype.draw = function() {
console.log(this.x);}
2017-05-02
举报