hey all, considering filing an issue on GH about typescript not properly narrowing in this scenario:
let values = [undefined, 1, 2, 3, undefined]
// -> (undefined | number)[]
values = values.filter(Boolean)
// TS should now know that values cannot be undefined, and the type of values is number[]
Is this behavior intentional? It's frustrated me for the longest time that you have to manually cast the result of the filter call to, say, number[] for it to know it won't be undefined