var Animal = function(){ this.public = new Object(); }; Animal.prototype = { public: { legs: 0 } }; var bird = new Animal(); bird.public.legs = 2; var dog = new Animal(); dog.public.legs = 4; alert(bird.public.legs);