javascript - Call anonymous function with 'this' from function -
How can I execute this mismatched function with the reference of a given function through a call?
function testing (text) {this.first = 'test'; Console.log (this.first); } {Function (val) {return function (val) {console.log} (this.first);}} ()). Call (test)
I did not take it in myself; Before entering the return function:
(function (val) {var self = this; // This line returns function (val) {console.log (self.first);}} )). Call (test)
Comments
Post a Comment