Team LiB
Previous Section Next Section

Summary

An object-oriented language is required to have three tools: encapsulation, inheritance, and polymorphism. JavaScript contains these three tools, making it an object-oriented language. JavaScript provides the programmer with many built-in, or native, objects. Each object generally has a collection of properties and methods. Properties are nothing more than variables stored within the object. A property can be either a primitive data type or an instance of another object. Methods are functions that are linked to the objects themselves. Usually you will need to create an instance of an object before you can call its methods, but there are some objects (Window and Document) that have static methods that can be called at any time. There is a special method called a constructor that is used to instantiate each instance of a method.


Team LiB
Previous Section Next Section