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

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -