The Never Type

Never Type
πŸ‘¨β€πŸ’Ό You've learned how never works in functions that always throw.
πŸ¦‰ A never return type is perfect for helpers like throwError. It tells TypeScript (and other readers) that the function does not return normally:
function throwError(message: string): never {
	throw new Error(message)
}
This makes it clear that execution stops on that path, which helps keep your code safe and predictable.

Please set the playground first

Loading "The Never Type"
Loading "The Never Type"