Show Menu
Cheatography

Typescript Cheat Sheet (DRAFT) by

Typescript

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Basic Types

Boolean
boolean
Decima­l/F­loa­t/I­nteger
number
String
string
Array
[] or Array<­typ­e>
Tuple
[Key, Value] ie [string, number]
Enumer­ation
enum [name] {list of items}
Any
ANYTHING
Void
void, (absence of type)
Type Assertion or Casting
(someValue as string­).l­ength or (<s­tri­ng>­som­eVa­lue­).l­ength;

Variable Declar­ations

Variable declar­ation
let
Constant declar­ation
const
Try - Catch
try {} catch (e) {}
Spread operator (contents of array)
...[va­riable]
Object Decons­tru­ction
{objec­tPr­operty: Value, ... }