Is there a clean and convenient way to do something like:
const x: (string|undefined)[] = ['aaa', undefined, 'ccc'];
const y = _.filter(x, it => !!it);
so that TypeScript recognizes the type of y as string[], without having to write my own function doing the filtering? (I.e. is there a way to have the language feature that narrows the type of a variable in say an if block apply to arrays?)