Created
June 5, 2013 16:39
-
-
Save fnobi/5715339 to your computer and use it in GitHub Desktop.
Coffeeか、Typeか。 〜比較しながらの入門編〜 ref: http://qiita.com/items/8bd24c0994a2015ffbeb
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
| npm -g install typescript |
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
| npm -g install coffee-script |
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
| class Human { | |
| name: string; | |
| constructor (name: string) { | |
| this.name = name; | |
| } | |
| hello () { | |
| console.log('My name is %s.', this.name); | |
| } | |
| } |
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
| class Human | |
| constructor: (@name) -> | |
| hello: -> | |
| console.log("My name is #{@name}.") |
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
| tsc Human.ts index.ts --out index.js |
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
| coffee -j index.js -c Human.coffee index.coffee |
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
| /// <reference path="Human.ts" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment