javascript中对象继承_inheritance in javascript

In javascript, the inheritance method is so different with java,and some note here is to summary it.

Methods of inheritance
As usual with ECMAScript, you have more than one way to implement inheritance. This is because inheritance in JavaScript isn’t explicit; it’s emulated. This means that the interpreter doesn’t handle all the inheritance details. It is up to you, as the developer, to handle inheritance in a way that is most appropriate for your situation.

Object masquerading

function ClassA(sColor) {
this.color = sColor;
this.sayColor = function () {
alert(this.color);
};
}

function ClassB(sColor) {
this.newMethod = ClassA;
this.newMethod(sColor);
delete this.newMethod;
}

function ClassB(sColor, sName) {
this.newMethod = ClassA;
this.newMethod(sColor);
delete this.newMethod;
this.name = sName;
this.sayName = function () {
alert(this.name);
};
}

the this keyword references the currently created object in a constructor; in a method,however, this points to the owning object. The theory is that treating ClassA as a regular function instead of as a constructor establishes a type of inheritance.

but in java,the inheritance is extend the ancestors’ all method.it looks like:

public class A{

}

public class B extends A{

}

and then we can use call() to replace the inheritance:

function ClassB(sColor, sName) {
ClassA.call(this, sColor);
this.name = sName;
this.sayName = function () {
alert(this.name);
};
}

also apply() can use to reach this effect:

function ClassB(sColor, sName) {
ClassA.apply(this, new Array(sColor));
this.name = sName;
this.sayName = function () {
alert(this.name);
};
}

But i have a question,why javascript use call and apply to simulate object inheritance.And also why not make a extends pattern and it will looks like:

function ClassB extends ClassA(sColor, sName) {
this.name = sName;
this.sayName = function () {
alert(this.name);
};
}