In traditional (class based) OOP, there are classes and objects. Every object has a class, and an object is an instance of its class. Classes create objects and determine their behavior. All objects of the same class have the same behavior, that is they share the same set of methods (or functions).
If you consider a class as being the blue print of a standard apartment in the block where I live, my apartment is an instance, my neighbor's apartment is another instance, ... They share the same project (the class), but they are different apartments (instances [objects] of that class). They have identical properties, but their properties have different values. My bathroom is painted in blue, while my neighbor's is white.
But, as you put this question into the JavaScript Forum, you should know that JavaScript has no classes, thus it has no instances (in the way they are defined in classical OOP). In JavaScript everything is (or can be transformed into) an object. Objects are to be created in several ways. From these, using a constructor (a new function) is more alike using a class (in other languages). But objects, in JavaScript, are not the instances of a constructor. JavaScript objects have a prototype, which is something different from a class, because JavaScript uses the delegation (from object to its prototype), not the inheritance (from a class to an instance). If I take the example with my apartment, I can alter the blue print (its prototype), and split a room in two by rising a wall without altering my neighbor's apartment blue print
Bookmarks