I came across some code that has this structure in many places:
this.someFunction.call(this, param);
but it seems to me that this is just a more detailed input method
this.someFunction(param)
A pattern sometimes appears inside a function that is provided as a callback. It happens to use the Trunk, in case it is necessary. Something like that:
Backbone.View.extend({ // other stuff ... someFunction: function(param) { // ... }, anotherFunction: function() { this.collection.on("some_event", function() { this.someFunction.call(this, param); }); } });
Does the template really have an effect that is not equivalent to this.someFunction(param) , or was someone just nervous about closing without fixing the correct this ?
Thanks for any ideas!
Jeffrey martinez
source share