Created
June 27, 2012 21:31
-
-
Save phstc/3006997 to your computer and use it in GitHub Desktop.
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
class Commenter | |
constructor: (@author) -> | |
write: (message) -> | |
console.log "#{@author}: #{message}" | |
commenter = new Commenter 'Pablo' | |
commenter.write 'Hello World' |
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
(function() { | |
var Commenter, commenter; | |
Commenter = (function() { | |
function Commenter(author) { | |
this.author = author; | |
} | |
Commenter.prototype.write = function(message) { | |
return console.log("" + this.author + ": " + message); | |
}; | |
return Commenter; | |
})(); | |
commenter = new Commenter('Pablo'); | |
commenter.write('Hello World'); | |
}).call(this); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment