TypeScript Special Types: => any: using (any) disables type checking and defeats the purpose of using typescript. => unknown: using (unknown) signifies that the value expected can be of any type. It can be of string type, can be a boolean value, or it can be of a number type.
=> never: using (never) means that the code never reaches the part where any value is returned. So, In short....
If line number 2 has some throw exception like command written and line number 3 has return written, the code will never even reach line number 3 and so it will not be able to return any value at all.
=> union: We use (union type) when we are not sure which type of value will be returned. The returned value can be of any data type.
Note: Don't confuse this with any or unknown data types in typescript. any disables type checking, using unknown means that the returned value can be of any type, and using union type means that the value to be returned can be of any specified type.
P.S. Still learning so I might be wrong. Do correct me if so is the case. #clevercoderjoy