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);