Reputation: 1126
Just a simple question, but can't get an answer on my own.
In memory Array are use contiguous space to store the data.
Object use pointer to look where the data are stored.
(correct me if i'm wrong :D )
In Javascript Array are object, does it means that Array work like object for memory storage ?
Upvotes: 2
Views: 1483
Reputation: 28439
Since you can't get references to actual memory locations in Javascript, what difference does it make *how the memory is allocated? In Javascript, everything is an Object because there isn't even a type for anything (really)... var foo = 5; foo = "hello"; foo = function(){}; and so on and so forth. All you need to know is how an Array works in javascript. Don't worry about how it's storing its values and where... that's not something you have any control over and it makes absolutely no difference.
Upvotes: 3