instanceof is a binary operator used to test if an object is of a given type . The result of the operation is either true or false. It’s also known as type comparison operator because it compares the instance with type. Before casting an unknown object, the instanceof check should always be used.
Read moreWhat is type alias in TypeScript?
Type aliases allow you to create a new name for an existing type . The following shows the syntax of the type alias: type alias = existingType; The existing type can be any valid TypeScript type.
Read more