Skip to content

Instantly share code, notes, and snippets.

@JaykeOps
Created September 2, 2017 17:37
Show Gist options
  • Save JaykeOps/6e3ce8e6eca68809168798412c19668f to your computer and use it in GitHub Desktop.
Save JaykeOps/6e3ce8e6eca68809168798412c19668f to your computer and use it in GitHub Desktop.
Just some notes I took while following along the TypeScript documentation
//1.0 - Typed function types
//Synatx 1
let addition1 =
function (x: number, y: number): number { return x + y; };
console.log(addition1(5, 5));
//Synatx 2
let addition2 = (x: number, y: number) => { return x + y; };
console.log(addition2(5, 5));
//Synatx 3 - Just explanatory
let multiplication: (x: number, y: number) => number =
function (x, y) { return x * y };
console.log(multiplication(10, 10));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment