Howdy, Econophil. Apologies for the late response.
There are different types of object-oriented languages. The most common are class-based OO languages (C#, C++, Java, etc). A programmer defines a class and creates instances of that class. So in class-based languages, yes, every object is an instance of a class.
JavaScript is a prototype-based language. It doesn't have classes; instead, objects are created from other objects. What we call data types (or reference types, to be more accurate) are nothing more than a function (which is an object) that is called with the new operator.
Data type (or reference type) is the logical equivalent of the concept of class, but they are two different things.
JavaScript is getting a class construct in the future, but it isn't a true class. It's syntactic sugar for the constructor and prototype code that we write today.
|