Javascript – Function returned from another function
I observed a difference in output when trying to run similar function. function func1(){ function sum(){ console.log(2+5); } return sum(); } func1(); function func2(){ return (function sum(){ console.log(2+5); }) } func2(); From func1, the output is 7. But from func2,…