title: Why and how are JavaScript datastructures, like Arrays, not fixed length?
body: <p>I'm rusty on CS concepts and am watching <a href="https://video.cs50.net/2016/fall/lectures/5?t=9m22s" rel="nofollow">this review</a> and around 9:00 they talk about arrays being fixed length. This is because they need to tell the stack how much memory to allocate to the structure beforehand so that other memory locations can be allocated elsewhere.</p>
  
  <p>I'm currently a JavaScript developer, but worked with Java in the past. Why is it that a JavaScript array can be dynamically allocated (<code>[].push(element)</code>)? </p>
  
  <p>I'm asking this from a more deep level perspective- I understand that Arrays in JS are objects with no concept of "length", but it becomes confusing when you can request the length of an array and access its values by index like an Array. </p>
  
  <p>So does that mean JS objects only interact with Heap memory? Is there any concept of fixed length structures in JS? </p>