Arrays & Iterables
Compact Array (Remove Falsy)
easyJS SpecificJS / TS3 tests
Problem Statement
Implement `compact(array)` that returns a new array with all falsy values removed (`false`, `null`, `0`, `""`, `undefined`, and `NaN`).
Examples
Example 1: compact([0, 1, false, 2, '', 3, null, undefined, NaN]); // [1, 2, 3]
JavaScript & TypeScript starter code included
Run this as a live interviewPractice solo
3 test cases. No second person needed.