var Arr1
creates a memory footprint that holds a reference to nothing. So, yes, there is a cost to this, but it is minimal.
But, var Arr2 = []
creates a memory address that is holding a reference to a new Array object, so there is more of a footprint there. Even though the array is empty, it is a unique instance of an Array
object, which, itself uses the single Array.prototype
to inherit from. It's the population of the Array that will really take up memory, since even a billion empty arrays don't have to store anything that is not already being stored by Array.prototype
. Even with a billion empty arrays, they all inherit from just one Array.prototype
object and that is where the native API for arrays is stored.