News for hackers. Stuff that matters.
Re:All I Want for Christmas Is These Seven TypeScript Improv... by akdor1154 on Monday December 26, 2022 @04:48AM (#34136192)

    [1,2,undefined,3]
    .filter(<T>(x: T|undefined): x is T =>
        typeof x !== 'undefined'
    );
Yes builtin lang support would be better, but that gets you out of trouble in a pinch, without adding more 5 line npm baggage.

N.B. if you are in a JSX file, you'll need to add a comma: `<T,>`

There are no comments on this comment yet.