Is there a synonym (singular word) for "removing emptiness"?

calin92540842 profile image PDS OWNER CALIN (Calin Baenen) ・1 min read

I am making a JavaScript library and need to know if there is a singular word for "Removing emptiness". And if not, should I make my own word? If so, should it use root words?



markdown guide

If it's doing something like removing null or undefined values, then I might call it something like compact (think of a trash compactor that "removes the emptiness" between the garbage to make it smaller)


Ok, I will use that name, though it's removing truly empty values.

[undefined].isEmpty(0); // false
[null].isEmpty(0); // false
[,2,3,4,,5].isEmpty(0); // true

It seems like you are detecting gaps in a sparse array.
In which case it isn't that the value is empty, it is that the index is missing.

In which case you need to consider what 'removing a missing index' means.

If it means changing a sparse array with gaps to a dense array without gaps by moving the indexes down, then compact would make sense.

But you haven't expressed what you want to do clearly, so it's hard to be sure. :)

It will turn




Yeah, then you're making a sparse array compact by adjusting the indexes to be contiguous.

So compact sounds good.


Thanks for the name suggestion. It really helps.


Filling? Only thing I can think of, maybe not a great library name


It's not going to be the lib name, it's going to be a method, but I just need a name that represents the removal of emptiness, and I like your idea.
English is imprecise, and wacky.
Nothing will be filled in, but I guess that's the closest answer I got.


Fill. There is devoid, but I don't think it really carry much meaning.

If I had to create my own words, I would say enload.


Thank you for the wonderful suggestion!