Skip to content

@thejh /javascript.js
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
var Thing;
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
};
Thing = (function() {
__extends(Thing, EventEmitter);
function Thing(name) { //this constructor function is the scope of `name`
this.getName = function() { //but `this` is what the constructor returns, so this method is public
return name;
};
}
return Thing;
})();
class Thing extends EventEmitter
constructor: (name) ->
@getName = -> name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.