3 ms·
The ruby method removes "nil", not "false". The ruby method has absolutely nothing to do with false whatsoever, while lodash makes explicit reference to it. The
by chmod775 7y ago
The ruby method removes "nil", not "false". The ruby method has absolutely nothing to do with false whatsoever, while lodash makes explicit reference to it. The ruby method is intended to just remove holes in arrays, not remove values. JavaScript has the concept of holes in arrays, but that's not what the lodash function is about.
They're 2 different functions/methods with 2 different ideas behind them. They're absolutely not each other's equivalent in their respective language.