3 ms·
Agreed. The author is conflating discriminated unions with optional properties. His example is better off as a discriminated union because the optionals are set
by drew-y 6y ago
Agreed. The author is conflating discriminated unions with optional properties. His example is better off as a discriminated union because the optionals are set based off of it's type. There are plenty of situations where optional properties do make sense. Particularly where a default value can be used.