, , - . . , . .
:
function MyClass (a, b)
{
this.publicProperty = 1;
var _privateProperty = 2;
function _privateMethod () {
};
this.publicMethod = function () {
};
}
MyClass.classMethod = function () {
};
var instance = new MyClass(a, b);
:
function DerivedClass(a, b, c)
{
MyClass.apply(this, arguments);
this.anotherProperty = 3;
function _anotherPrivateMethod() { };
this.publicMethod = function () {
};
}
DerivedClass.classMethodMethod = function ()
{
};
JavaScript Duck Typing (http://en.wikipedia.org/wiki/Duck_typing). / , . , , newfangles.
- , - , , , , . , Javascript- .
, .