0

I have an array in which I store elements fetched from database at the index position of their Id for convenience. Doing so, I can have a lot of in my array, and now I wonder if these slots are actually stored in memory by angular (which would lead to changing my implementation) or not. I did some research but couldn't find an answer. Example : Fetch from DB : object{id=3, .....}, object{id=5, ....} Array constructed : [<3 empty slot>, 3, <1 empty slot>, 5]

Developer
  • 3
  • 2

1 Answers1

2

That doesn't really have nothing to do with Angular, but with the language per-se, in this case, Typescript, which translates to Javascript.

That means your answer can be found in the accepted answer of this question

TL;DR: No, those slots don't actually occupy memory