So I was reading the official docs of Typescript about union types, and I was thinking that it is the same as "discriminated unions" in F# (granted they have different syntax but same concept), as I have a F# background and given the fact that both are backed by Microsoft. But looking at the docs, F# doesn't really make a distinction between "union types" and "discriminated unions": https://fsharpforfunandprofit.com/posts/discriminated-unions/
However, Typescript does make a distinction between these two concepts:
Union types: https://www.typescriptlang.org/docs/handbook/advanced-types.html#union-types
Discriminated Unions: https://www.typescriptlang.org/docs/handbook/advanced-types.html#discriminated-unions
So I was wondering if there is really a distinction in the concepts themselves or is just some language dependent concept?
What I understand so far is that union types in F# are also discriminated unions because you can discriminate the union type using match expressions and deconstructing.
However, you cannot do the discrimination with Typescript as the language does not provide a specific expression to do that, so yo need to discriminate by a value, that all union types have, the discriminant. Is this correct?