Functions#
TypeScript adds parameter types, return types, optional parameters, and function overloads to JavaScript functions. It can also type callbacks, methods, and constructors for full type safety across your codebase.
Typed Functions
Functions with type annotations
Annotate parameters and optionally the return type