Unlike other OOPLs, object-oriented JavaScript is prototype-based and does not utilize and support class statements. In turn, functions are used as a means to represent a class. New objects are derived by using a prototyping technique and by calling the object’s native constructor.
In most object-oriented languages, objects are derived from a class. Vehicle, which is a class in most other languages, is an object in object-oriented JavaScript. The other derivatives - such as car, truck and tractor - are prototypes of the object vehicle that are created by calling the vehicle method.
0 Comments