Friday, December 24, 2010

Javascript is Object Oriented Language

It might surprise many of the developers, but Javascript script is Object Oriented. Whatever code you write in Javascript you are more or less creating or handling created objects. There are only five primitive datatypes in Javascript which are not objects, they are number, string, boolean, null, and undefined.

So, What is an Object? Just like as it is in other programming languages, an object in Javascript is just a collection of named properties, a list of key-value pairs (almost identical to an associative array in other languages). Some of the properties could be functions (function objects), in which case we call them methods.

No comments:

Post a Comment