[1,2,undefined,3] .filter(<T>(x: T|undefined): x is T => typeof x !== 'undefined' );
N.B. if you are in a JSX file, you'll need to add a comma: `<T,>`
N.B. if you are in a JSX file, you'll need to add a comma: `<T,>`