I’m used to Java so when i try to so something like this:
function subSection(pattern){
this.total = 0;
this.pattern = pattern;
this.distance=0;
}
function enhancer(pattern){
__proto__:subSection;
this.pattern = pattern;
}
function silencer(pattern){
__proto__:subSection;
this.pattern = pattern;
}
var a = new enhancer("aaa");
document.write(a.distance)
I get “undefined”. I thought i have inherited the total and distance data members
But it’s only a Mozilla proprietary property as
RobGsaid.DEMO.
Update:
DEMO.
Useful Links: here and here.