Spaghetti Tom
Tuesday, March 14, 2017
Use bind to pass the scope of this down to a JavaScript function without the self=this hack!
var x = function(whatever) {
return whatever + this.something;
}.bind(this);
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment