Inspect TypeScript types: 15 levels of primitives, unions, literals and inference. The clearest beginner TypeScript game around.
In TypeScript, you can declare a variable's type using the : type syntax. TypeScript will check whether the given value matches the declared type.
An array in TypeScript can be declared with type[] or Array<type>. Every element must match the specified type.
A union type lets a variable accept more than one data type. It's written with a | (pipe) between the allowed types.
An object type in TypeScript describes the shape of an object, including the property names and their types. The given object must have matching properties.
A function in TypeScript can declare its parameter types and its return value type. TypeScript checks whether the returned value matches the declared type.
TypeScript has two syntaxes for arrays: string[] and Array<string>. They're identical. Array<T> uses generic syntax.
x?arr?items?And more, 15 levels in all.