View Full Version : Writing JavaScript classes

09-21-2005, 06:57 PM
I have seen some JavaScript code written in the form of classes in which methods are added on to an initially defined function's prototype.

This is a very new way of writing JavaScript for me though I would like to understand how this works.

Can anyone explain the in's and out's of this or point me to a few good tutorials on the matter?

I have tried searching Google but mainly turn up information on modifiying the "class" property.

Thanks in advance!

09-21-2005, 07:39 PM
While browsing the forums in search of something unrelated I stumbled upon these web sites:

This holds the majority of the examples I was looking for, while the two above explain more OO details of JavaScript.

I am trying to arrive at an understand of JavaScript object-oriented programming from a PHP object-oriented perspective.

Am I mistaken or does the use of the "this" keyword work slightly differently in some manner in JavaScript?