Aliases with Type

In this lesson, we will see how to create aliases for types.

Type aliases are the shortcut names for existing types or many types under a single name. The goal of creating an alias is to increase the readability of the code as well as to have a reusable and common way to identify a type.

Type aliases for primitives

At its simplest, an alias can represent a single primitive. The alias will have the same properties as the underlying primitive type. The following example shows that the function takes an IP as the type, which is ...