I am currently javascript developer coming from java, but advancing my knowlendge in data structures & algorithms, so in Java, C, or C++, while declaring array we need to assume its length first like so:
int[] sampleArray = new int[6];
and there are 24 bytes of memory consumed by this array, and we need this because after 24 bytes, there may be some other data type consuming following x bytes. but in javascript we do not need to set the length, and how javascript determines how much memory array will consume?