Created
June 4, 2015 20:49
-
-
Save joshuakfarrar/20a426d1240fd091d39f 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
╭─sent1nel@syndicate ~ ‹2.1.1› | |
╰─$ cat greeter.js | |
class Greeter { | |
constructor(name) { | |
this.name = name; | |
} | |
greeting() { | |
return `Hey, ${this.name}!`; | |
} | |
greet() { | |
console.log(this.greeting()); | |
} | |
} | |
var greeter = new Greeter('sent1nel'); | |
greeter.greet(); | |
╭─sent1nel@syndicate ~ ‹2.1.1› | |
╰─$ iojs --harmony_modules --harmony_classes --use_strict greeter.js | |
Hey, sent1nel! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment