In
this blog entry I talked about integration JavaScript Object Diagam (JSOD) with Chrome Devtools. While thinking about it in terms of how to lay out the objects in JSOD I came to this realization i.e. there are three types of objects from the point of view of JSOD. These are as follows:
- Standard objects [ 1 ] - these are typically created using the new operator on a constructor function. These inherit the constructor [ 4 ] property from the prototype object of the constructor function. The standard object's __proto__ [ 7 ] hidden link refers to prototype objects.
- Prototype objects [ 2 ] - these are objects that are prototypes of functions which are internally created by new operator. These objects have their own constructor [ 5 ] property. The standard object's __proto__ [ 7 ] hidden link (typically) refers to these objects. The prototype property of the constructor functions point to these objects.
- Function object [ 3 ]- these are function objects used for creation of other object's using new operator. The prototype [ 6 ] property of function objects refer to prototype object.
I hope that JSOD becomes a standard way for diagramming JasvaScript objects.