• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

The Prototype Concept

Much of the difference between JavaScript and languages like Java is that OOP in Java is based on a different type of class than in JavaScript. In traditional OOP, a class is a set and any object is an instance of that class or set. However, in JavaScript, the concept of class revolves around the concept of a prototype. Unlike the set concept of class that treats an instance of an object to be a member of the class, the prototype concept treats the named object with all of the properties that all members of the class have. For example, consider the class called Mall.

A Mall object has several characteristics expected in all malls. The following lists what just about any mall has:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint