Using let with for loop
I have a doubt here with const .
If the value of button is changing after every iteration i,e button 0 , button 1 , then why he used const to declare button ?
Steven Parker177,727 Points
In this video, "button" is assigned inside a loop. Before the loop repeats, "button" is disposed (no longer exists).
On the next iteration, a new "button" is created. The old one is not being re-assigned.
Oh . Thanks
I just got confused with the word "const" , I forgot that the value gets stored in stack . And it also vanished into next repitition.
Thanks again .