Archives

February 2012

Javascript OOP

Blog: Javascript

Another way to go about some OOP for JavaScript. The bracket incased function initialises a self executing anonymous function that encases the class. In the example below are several ways of calling the class methods and properties.

Main Application or JS file. [code snippet] A JS Class Example [code snippet] If you want to create a singleton you can do it as follows.

[code snippet]

READ MORE