1unitedpower: variationen an Objekten-deklaration! Wann ist welche Sinnvoll?

Beitrag lesen

Das heißt, mit var obj = { } erzeugst du eine Instanz von Object.prototype und mit var arr = [ ] eine Instanz von Array.prototype, wobei Array wiederum von Object erbt.

Das hast du unglücklich formuliert, denn Instanzen werden in JavaScript von Konstruktor-Funktionen gebildet, nicht Objekt-Prototypen:

[1,2,3] instanceof Array.prototype // Uncaught TypeError: Expecting a function in instanceof check, but got #<Object>
[1,2,3] instanceof Array // true

Dennoch gilt natürlich, dass sowohl Array.prototype als auch Object.prototype in der Prototypkette von [1,2,3] auftauchen:

Array.prototype.isPrototypeOf([1,2,3]) // true
Object.prototype.isPrototypeOf([1,2,3]) // true