General question about prototypes - Is there another way to do inheritance?


#1


Is there a better way to do inheritance than the prototype method?

So i have given an example below of inheriting from an object using the prototype method but it looks clunky and i was wondering if anyone knew a simpler way to link objects
thanks for any help, someone mentioned that the prototype is really just for testing code for errors and so was wondering what the normal method is


//create parent
function Parent () {
propertyA="something";
propertyB="something else";
}

//create child
function Child () {
propertyC="another property";
}

//inherit from parent
Child.prototype = new Parent();

//create instance of child
var instance= new Child();


#2

I don't think they were refering to JS prototypes