Abstract Types abstract class Div {}

Access Modifiers class Box { private location }

Algebraic Data Type garageContents = empty | vehicle

Anonymous Functions Lambdas () => doSomething()

Async Await async doSomething => await somethingElse()

Binary Operators 1 + 1

Bitwise Operators 3 == (2 | 1)

Block Comments /* a looong comment */

Booleans doBabiesSleep = false

Case Insensitive Identifiers AnYcASE = 2

Central Package Repository Pattern npm install lani

Classes class Dog {}

Comments # a comment

Conditionals if (isTrue) doSomething()

Constants const ONE = 1

Core Language Development Hosted on GitHub git clone microsoft.com/typescript

Dependent types sortedList // a list where is sorted is true

Destructuring {name, age} = person

Directives use strict;

Dispose Blocks Pattern with something: do something()

Duck Typing length() // makes me an iterator

Dynamic Properties person.age = 50

Exceptions throw new Error("Uh oh")

Function Composition undefined

Function Overloading Ad hoc polymorphism add(string: str, string2: str)

Functions routines or procedures or methods function foo() {}

Garbage Collection var iDontNeedToFreeThis

Generators yield 2

Generics function identity<T>(arg: T): T

Gotos goto 10

Identifiers name = Bob

Import Pattern import package

Infix Notation 1 + 2

Inheritance class Box extends Cube

Integers int score = 28

Interfaces interface Sendable

Iterators for a in collection()

Letter-first Identifiers seven11 = "OK" // 711 = "ERROR"

Lists array or vector or sequence [2, 3, 10]

Macros #define height 10

Maps dict or dictionary or object or record or struct or hashtable or keyed list or associative array {name: "Mary"}

Merges Whitespace result = 1 + 2

Mixins extends structure, paintable

Module Pattern module Foobar {}

Monad g >>= f

Multiline Strings hello = """hello

world"""

Multiple Inheritance extends parentWhichExtendsSomethingElse

Namespaces namespace Stuff {}

Operator Overloading def __add__(): doSomethingDifferent()

Partial Application add5 = num => addNumbers(10, num)

Pattern Matching fib 0 = 1; fib 1 = 1

Pipes ls | wc

Pointers int *foobar

Polymorphism a + "b"; 1 + 2

Postfix Notation 2 3 4 + 2 -

Prefix Notation + 1 2

Print Statements print "Hi"

Processor Registers eax 2

Range Operator 1 ... 10

Refinement Types evenInt where int % 2 = 0

Runtime Guards f x | x > 0 = 1 | otherwise = 0

Semantic Indentation if true(newline/space)print True

Semaphores singletonIsSet = 0

Statements print Hello world

Static Methods static bark() {}

Static Typing int score = 100

Streams echo 123 | 123.txt

Structs struct account { int account_number; char *first_name; float balance; };

Switch Statements switch animal: case dog-buy; case cat-sell;

Templates template TCopy(T) {}

Ternary operators true ? 1 : 0

Traits use redBorder

Triples Boston isCapitalOf Massachusetts

Type Parameters function identity<T>(arg: T): T {return arg}

Typed Holes 2 + _ => 2 + [int|float]

Unicode Identifers δ = 0.00001

Union Types any = string | number

Units of Measure Boston isCapitalOf Massachusetts

undefined virtual Shout();