In the following code, I want pass a reference to the print_season function with parameter "winter" into the function inner_function.
tony = {
print_season: function (season) {
console.log(">>season is" + season);
},
report: function () {
console.log(">>report");
this.inner_object.inner_function(this.print_season("winter"));
},
inner_object: {
inner_function: function(callback) {
console.log(">>inner_function=" + callback());
}
}
}
tony.report();
However, when I do the function is invoked rather than passed and I end up with:
TypeError: callback is not a function
console.log(">>inner_function=" + callback());
How do I pass the function with specific parameters in this case but to ensure it is not invoked?
Thanks.