Skip to content

Instantly share code, notes, and snippets.

@angus-c
Created October 19, 2013 23:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save angus-c/7062728 to your computer and use it in GitHub Desktop.
Save angus-c/7062728 to your computer and use it in GitHub Desktop.
//the old way
var a= {
aa: function() {
return this;
}
}
a.aa(); //a :)
//the new way
var b= {
bb: () => this
}
b.bb(); //window :(
b.bb.call(b); //window :(
var c = {};
c.cc = b.bb
c.cc(); //window :(
var d = {};
Object.mixin(d, b);
d.bb(); //window :(
var e = {};
Object.assign(e, b);
e.bb(); //window :'(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment