Thank you. It's amazing article. I love your short explanation foreach section. It's make me clear about it. I have question about "Discriminated Unions" and "in operator". Which one I should use for narrow type. now it's make me a little bit confuse because it's may be same thing.
I would lean with discriminated unions over using the in operator because they are easier to use. With the in operator, you might find yourself writing more complex checks if two or more types have a lot of overlapping properties. For simple check though, you can use them interchangeably, with no issue at all.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thank you. It's amazing article. I love your short explanation foreach section. It's make me clear about it. I have question about "Discriminated Unions" and "in operator". Which one I should use for narrow type. now it's make me a little bit confuse because it's may be same thing.
I would lean with discriminated unions over using the in operator because they are easier to use. With the in operator, you might find yourself writing more complex checks if two or more types have a lot of overlapping properties. For simple check though, you can use them interchangeably, with no issue at all.