In the below visualisation,
There are two array objects(
bikes) that are created with below syntax,
var cars = new Array("Saab", "Volvo", "BMW"); var bikes = ["Honda", "Yamaha"];
[[Class]] property value is
In addition, we also have
Array.prototype, which is fully functional array, as shown below,
> Object.prototype.toString.call(Array.prototype); "[object Array]" > Array.prototype = "Volvo"; "Volvo" > Array.prototype = "BMW"; "BMW" > Array.prototype.length; 2
Generally, When you put something on the
prototype, every instance of the object shares the same properties.
length property as member, What is the idea behind
Array.prototype being fully functional array?