Created
September 2, 2017 17:37
-
-
Save JaykeOps/6e3ce8e6eca68809168798412c19668f to your computer and use it in GitHub Desktop.
Just some notes I took while following along the TypeScript documentation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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