I have an array which contains a few million elements; nearly half of the indexes will be empty. What is the most memory efficient way of filling these empty indexes?
My limited understanding is that both are stored as strings of their name; and each char in a string requires 2 bytes. So null being 4 chars is 8 bytes; while undefined is 8 chars or 16 bytes. If this is the case would it be better to store these index as an empty string?