During my online CS class, we covered the topic of how Arrays and memory work. The teacher used C as an example to explain that you cannot add extra elements to a full Array. As someone who started with JavaScript, I found it interesting that in JavaScript, the Array.push() function allows for adding elements easily. However, this concept seemed different from what I had learned in regards to Arrays. Curious, I turned to Google and StackOverflow but couldn't find a clear answer on why JavaScript can do this.
Does JavaScript create a new Array with added elements and point the variable to the new Array, or is there another explanation?