chinmay.sahoo
New member
JavaScript is based on a simple object-oriented paradigm. This paradigm is often called object based, as opposed to object oriented. If you are used to a truly object-oriented language such as C#, Java, or C++, you will find much
of that functionality is missing in JavaScript. For example, classes do not exist in JavaScript (all objects belong to one “class”), nor do packages (because a package groups classes together). The object hierarchy in JavaScript is a containment hierarchy, not an inheritance hierarchy as in Java and C++. That is, an object does not inherit from other objects, but it can be contained by another object if it is a property of that object. Most object-oriented languages require static resolution of objects at compile time. If all this talk of inheritance hierarchies seems foreign to you, don’t worry. The purpose of this section is to explain to readers who are used to true object-oriented programming what is not available to them in JavaScript.
However, an object-oriented language may require dynamic method bindings because polymorphism allows multiple definitions of methods sharing a common name. Calling such polymorphic methods often cannot be resolved until run time. JavaScript is completely based on dynamic binding. That is, object references are checked at run time. There are many other differences between the object paradigm in JavaScript and the one in full object-oriented languages (such as Java and C++).
of that functionality is missing in JavaScript. For example, classes do not exist in JavaScript (all objects belong to one “class”), nor do packages (because a package groups classes together). The object hierarchy in JavaScript is a containment hierarchy, not an inheritance hierarchy as in Java and C++. That is, an object does not inherit from other objects, but it can be contained by another object if it is a property of that object. Most object-oriented languages require static resolution of objects at compile time. If all this talk of inheritance hierarchies seems foreign to you, don’t worry. The purpose of this section is to explain to readers who are used to true object-oriented programming what is not available to them in JavaScript.
However, an object-oriented language may require dynamic method bindings because polymorphism allows multiple definitions of methods sharing a common name. Calling such polymorphic methods often cannot be resolved until run time. JavaScript is completely based on dynamic binding. That is, object references are checked at run time. There are many other differences between the object paradigm in JavaScript and the one in full object-oriented languages (such as Java and C++).