Class.extend

Creates new class.

Syntax

existingClass.extend( instance_methods [, class_methods] )

Parameters

Parameter Description
instance_methods object containing members that will become instance members of defined class
class_methods object containing members that will become class (static) members of defined class

Description

Class allows easy construction of JavaScript objects that implement classic OO inheritance.

Defining constructors

Constructors are defined using special method init

The name of init function (in this case MyClass) is going to be used as a name of object's constructor function:

Calling overridden base class member

Returns.

New class definition (constructor function).

Example

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.