4const bool: boolean = true;
5const list: number[] = [1, 2, 3];
6const array: Array<number> = [1, 2, 3];
7const pair: [string, number] = ['hello', 10];
9for (let i = 0; i < list.length; i += 1) {
19const str: string = 'Jake';
20const templateStr: string = `Hello, ${str}!`;
29interface SquareConfig {
33 [propName: string]: any;
37 (source: string, subString: string): boolean;
45type Easing = "ease-in" | "ease-out" | "ease-in-out";
48 private readonly greeting: string;
50 constructor(message: string) {
51 this.greeting = message;
55 return "Hello, " + this.greeting;
59let greeter = new Greeter("world");
62 move(distanceInMeters: number = 0) {
63 console.log(`Animal moved ${distanceInMeters}m.`);
67class Dog extends Animal {
69 console.log("Woof! Woof!");
83interface Point3d extends Point {
87let point3d: Point3d = { x: 1, y: 2, z: 3 };
93let myAdd = function (x, y) {
101function identity<T>(arg: T): T {
105let myIdentity: <T>(arg: T) => T = identity;
107class GenericNumber<T> {
109 add: (x: T, y: T) => T;
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list