I have an object method a like below:
var f = {
a: function(e){
e.call();
console.log(t); // Here should print “Hello world”
}
};
f.a(function(){
f.a.t = "Hello world";
// How to pass the string “Hello world” into the object method “a” ?
});
e is an anonymous function. I call the e and now I want to pass a string Hello world into the object method a. If it's not allowed to use global variable, how can I pass the string into the object method?