Skip to content

Instantly share code, notes, and snippets.

Michael Bester kimili

View GitHub Profile
@kimili
kimili / compact.js
Created Sep 19, 2018
JavaScript Compact
View compact.js
const compact = arr => arr.filter(Boolean);
compact([1, false, 2, '', 3, null, 'abc']); // [1, 2, 3, 'abc']
You can’t perform that action at this time.