core error

inheritance in javascript

Posted on: 17/07/2011

Since Javascript is ‘class-free’ inheriting is not part of the definition of a class but it is handled by the method .inherits(<classn

ame>) and it’s done in run-time.

For example:

function ZParenizor(value) {
    this.setValue(value);
}

ZParenizor.inherits(Parenizor);

Now ZParenizor has inherited all the methods and attributes from Parenizor and still they can be overwritten or overloaded.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


    • Justin Cooney: Great comic, this made me laugh!
    • Justin Cooney: Interesting, I didn't know about the Google App Engine, I'm glad I found your article on it!

    Categories

    %d bloggers like this: