4 ms·
I think the suggestion is for typescript to have one none type equal to undefined | null. The type checker could not error on undefined when null is required or
by seniorsassycat 6y ago
I think the suggestion is for typescript to have one none type equal to undefined | null. The type checker could not error on undefined when null is required or vice versa.
Then code should use != null comparisons which match the none types semantics without needing runtime code generation.
I think this would violate another typescript principles that existing libraries and patterns should be expressable in typescript.
Some schmuck wrote a library that accepts null but not undefined so typescript has to distinguish them.