I have a Pers(on) and an Employee, who is derived from Pers.
Pers = function(options){
this.Name;
this.ID;
this.init = function(options){
this.Name=options.Name;
this.ID=options.ID;
}
}
Employee = function(options){
this.Sal;
this.init = function(options){
this.Sal=options.Sal;
this.__proto__.init(options);
}
this.init(options);
}
Employee.prototype=new Pers();
Now when i create new objects...
var o=new Employee({Name:"Nik",ID:"1",Sal:100});
var p=new Employee({Name:"Tanja",ID:"2",Sal:200});
and alert their Name, i will get two times "Tanja".
Has anyone an idea?
__proto__anymore.