...

/

Function and Inference Return Types

Function and Inference Return Types

In this lesson, we will cover functions inference with many types along with the evolution of returns.

Inference with many types

Functions can return an implicit or explicit type. By default, TypeScript returns a void type. However, if not specified and the code returns a number, the return type would implicitly be a number. If later the function returns a string, what is the expected ...