js 继承

function Shape(name) {

  this.id = Utils.getUID();

  this.name = name;

}

Shape.prototype = {

  destroy: function() {},

  check: function() {}

}

function Circle() {

  Shape.call(this, 'circle');

}

Circle.prototype = Object.create(Shape.prototype);

Circle.prototype.draw = function() {}

posted @ 2017-07-19 10:40  springmin  阅读(91)  评论(0编辑  收藏  举报