Having implemented several different ways of javascript inheritance this is ultimately what I went with when I wanted to construct a javascript game engine for a browser rpg:
The player base class:
function Player(name, type, gender, experience, avatar){
this.name = name;
this.type = type;
this.gender = gender;
this.experience = experience;
this.avatar = avatar;
this.stats ={//getter, setter}
//lots more code
}
Adding a method to the player class
Player.prototype.decrease_life = function(decrement){}
//note that the keyword this in the decrease_life function will
//refer to the player that the method is called on.
Now the inheritance of the player class:
function Mage(name, type, gender, exp, avatar){
Player.apply(this, [name,type,gender,exp,avatar]);
//apply allows you to specify what the keyword
//this refers to in the Player super class.
}
Mage.prototype = new Player;
And finally we create a player:
current_player = new Mage(name,type,gender,0,avatar);
Which allows us to do this now:
current_player.decrease_life(20); //The mage loses 20 life!
Or do this:
current_player.stats.get();
//returns the mages stats, it does that because we used apply, and
//this.stats in the player class is referring to our mage now
As others have mentioned there is no best practice in javascript inheritance. I have found the above most closely imitates how you would expect inheritance to work in Java or C++, which have more typical inheritance structures.