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

Popular posts from this blog

c++ - C/pp Sockets, recv()/send() works only under gdb -

GO: Serve static pages -

objective c - How to open front/back camera at the same time in iOS developing? -