Skip to content

Instantly share code, notes, and snippets.

@moutend
Last active August 29, 2015 13:57
Show Gist options
  • Save moutend/9519672 to your computer and use it in GitHub Desktop.
Save moutend/9519672 to your computer and use it in GitHub Desktop.
CoffeeScript class
class I
doErrands: ->
'I did ...'
me = I
I = new I
console.log me.doErrands?() #undefined
console.log I.doErrands?() #I did ...
# // Generated by CoffeeScript 1.7.1
# (function() {
# var I, me;
#
# I = (function() {
# function I() {}
# I.prototype.doErrands = function() {
# return 'I did ...';
# };
# return I;
# })();
#
# me = I;
# I = new I;
#
# console.log(typeof me.doErrands === "function" ? me.doErrands() : void 0);
# console.log(typeof I.doErrands === "function" ? I.doErrands() : void 0);
#
# }).call(this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment