I mean that a type in TypeScript represents a set, like you learned about in math class. Like the set of all integers is a subset of the set of all real numbers. In TypeScript, the type string is a set that contains every string, but no numbers or functions or anything else. That's why you can pick out string literal types and union them together, but it's also why you can pseudo-extend a type by creating its intersection with another type.
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.
I mean that a type in TypeScript represents a set, like you learned about in math class. Like the set of all integers is a subset of the set of all real numbers. In TypeScript, the type
string
is a set that contains every string, but no numbers or functions or anything else. That's why you can pick out string literal types and union them together, but it's also why you can pseudo-extend a type by creating its intersection with another type.