码迷,mamicode.com
首页 > Web开发 > 详细

js 继承

时间:2017-07-19 11:56:38      阅读:180      评论:0      收藏:0      [点我收藏+]

标签:name   get   str   obj   circle   raw   create   uid   function   

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() {}

js 继承

标签:name   get   str   obj   circle   raw   create   uid   function   

原文地址:http://www.cnblogs.com/fe-huahai/p/7204465.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!