Deep Remove Falsy

Medium

Prompt

Implement a function deepRemoveFalsy(value) that returns a new value with all falsy values removed at every level of nesting. The input can be a primitive, an array, or an object.

The falsy values are: false, null, 0, '' (empty string), undefined, and NaN.

Empty objects {} and empty arrays [] that result from removing falsy values should also be removed.