compact.js 256 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 13 var filter = require('./filter'); /** * Remove all null/undefined items from array. */ function compact(arr) { return filter(arr, function(val){ return (val != null); }); } module.exports = compact;