Tuesday, 14 March 2017

Is function scope variable not writable

function add() { var counter = 0; counter += 1; return counter }

Why the counter variable dont get incremented after first iteration ? output is always 1.



via Ajay Kumar

No comments:

Post a Comment