I have a variable which is an array and I want every element of the array to act as an object by default. To achieve this, I can do something like this in my code.
You can instantiate an array of "object type" in one line like this (just replace new Object() with your object):
var elements = 1000; var MyArray = Array.apply(null, Array(elements)).map(function () { return new Object(); });