+ 1
Explain the Output
function foo(call){ return function(city){ console.log(call()+" from "+ city); } } function friend(){ return 'i call you back'; } foo(friend)('rajasthan'); In the above program when i write console.log instead of return inside the friend function the output is different says undefined why? Anyone explain this.
1 Answer