1 2 3 4 5 6 7 8 9 10 11 12 | 614× 1× | /** * Derive a dense array (no `undefined`s) from a single value or array. * * @param {any} x * @return {Array<any>} */ function toDenseArray(x) { return [].concat(x).filter(y => y !== undefined); } module.exports = toDenseArray; |