Skip to content

Instantly share code, notes, and snippets.

@OiNutter
Created July 15, 2011 14:10
Show Gist options
  • Save OiNutter/1084753 to your computer and use it in GitHub Desktop.
Save OiNutter/1084753 to your computer and use it in GitHub Desktop.
OiNutter.co.uk - Obscura - CoffeeScript Scope Example
(function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
object(function() {
this.prop = 'foo';
return this.bar = __bind(function(newProp) {
return this.prop = newProp;
}, this);
});
}).call(this);
object ->
@prop = 'foo'
@bar = (newProp) =>
@prop = newProp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment