Skip to content

Instantly share code, notes, and snippets.

@Radagaisus
Created November 3, 2012 11:38
Show Gist options
  • Select an option

  • Save Radagaisus/4007116 to your computer and use it in GitHub Desktop.

Select an option

Save Radagaisus/4007116 to your computer and use it in GitHub Desktop.
Hack to Access Object Literals with the Fat Arrow
# A very ugly hack to access object literals
# with the fat arrow:
#
# _this = obj = {}
#
# $.extend obj,
# hello: => @stuff()
#
# compiles to:
#
# var obj,
# _this = this;
#
# _this = obj;
# $.extend(obj, {
# hello: function() {
# return _this.stuff();
# }
# });
_this = obj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment