|
|
|
|
|
by mrblampo
1200 days ago
|
|
Interesting! The example [1, 2, undefined].filter(Boolean). // number[] is interesting because it makes use of the fact that the types of individual array members are known at compile time. I can think of some times when I have dealt with arrays that are defined at compile time, but not where I've needed to call .filter on such an array. Is there a common use case here? |
|
That's very appealing to be; I commonly .map() an array to a nullable type, then want to filter out the nulls.