Type Aliases
Type aliases allow you to give a new name to a type. This can be helpful for readability and when working with complex types.
type Point = {
x: number;
y: number;
};
Exercise
Create a type alias for a Rectangle
which contains properties for its width and height. Also, define a function that takes a Rectangle
as its argument and returns the area of that rectangle.