Created
April 6, 2018 16:21
-
-
Save jhyland87/7a028ba9b8d665af55a74d6a1fcf8e04 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
( 21)[Fri Apr 06 09:20:06| 1:000]{47}jhyland@MacBook-Pro:~/Documents/scripts/typescript/test(✓)$ cat oop.1.ts | |
'use strict' | |
class Greeter { | |
greeting: string; | |
constructor(message: string) { | |
this.greeting = message; | |
} | |
greet() { | |
return "Hello, " + this.greeting; | |
} | |
} | |
let greeter = new Greeter("world"); | |
console.log(greeter.greet()) | |
( 21)[Fri Apr 06 09:20:07| 0:000]{48}jhyland@MacBook-Pro:~/Documents/scripts/typescript/test(✓)$ tsc -t ES2016 oop.1.ts | |
( 21)[Fri Apr 06 09:20:12| 2:000]{49}jhyland@MacBook-Pro:~/Documents/scripts/typescript/test(✓)$ cat oop.1.js | |
'use strict'; | |
class Greeter { | |
constructor(message) { | |
this.greeting = message; | |
} | |
greet() { | |
return "Hello, " + this.greeting; | |
} | |
} | |
let greeter = new Greeter("world"); | |
console.log(greeter.greet()); | |
( 21)[Fri Apr 06 09:20:15| 0:000]{50}jhyland@MacBook-Pro:~/Documents/scripts/typescript/test(✓)$ node oop.1.js | |
Hello, world | |
( 21)[Fri Apr 06 09:20:19| 0:000]{51}jhyland@MacBook-Pro:~/Documents/scripts/typescript/test(✓)$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment