Skip to content

Instantly share code, notes, and snippets.

@zhoufenfens
Created July 17, 2013 12:50
Show Gist options
  • Save zhoufenfens/6020300 to your computer and use it in GitHub Desktop.
Save zhoufenfens/6020300 to your computer and use it in GitHub Desktop.
inherit
function Polygon(sides){
this.sides = sides;
this.setSides = function(s) {this.sides=s;}
};
function Tri(sides){
Polygon.apply(this,[sides]);
}
var tri=new Tri(4);
console.log(tri.sides);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment