Javascript – Anonymous Functions Vs Classic Function
I'm not able to figure out the reason for this behavior, can any one help me understand let counter= (function (){ let count = 0; return function() { count+=1; return count; } })() for (let i = 0; i< 3;…