I am trying to use OOPs in javascript. What i am trying is,
I have 2 classes say classA and classB. I am inheriting classA in classB. Like :
function classA(){
this.propA = "somevalue of A";
}
function classB(){
classB.prototype = new classA(); //inheriting
classB.prototype.constructor = classB; //updating constructor defination
this.propB = "somevalue of B";
}
Now i created the object of classB :
var classBObject = new classB();
and than trying to access base class property value with :
alert(classBObject.propA); //here i am expecting "somevalue of A"
but the alert shows me empty. Can anybody please tell me what i am doing wrong here ?