Monday, October 20, 2008

JavaScript's class-less objects

Java and JavaScript are very different languages, although the similarity in the names and the similar C-like syntax confuses people sometimes. Let's take a look at one pretty major difference and that is how objects are created. In Java, you have classes. Then objects, a.k.a. instances, are created based on those classes. In JavaScript, there are no classes and objects are more like hash tables of key-value pairs.

http://www.javaranch.com/journal/2008/10/Journal200810.jsp#a1

No comments: