Why can the iterator variable for a for... of loop be a const?

I was doing the exercises on the for … of article in JavaScript Syntax, Part 2: Loops and was wondering why a type error isn’t being returned. I assumed that since in each iteration when the value changes the same rules would apply if i declared const fruit = ‘apple’ and tried to change it to const fruit = ‘banana’;

Thanks!

https://www.codecademy.com/paths/full-stack-engineer-career-path/tracks/fscp-javascript-syntax-part-ii/modules/fecp-learn-javascript-syntax-loops/articles/javascript-the-for-of-loop

That does seem counter-intuitive. Check out the MDN documentation.

It doesn’t really give a solid explanation as to why const can be used, but does show an example where using let would be necessary. It seems to me that with each iteration, a new declaration occurs rather than assigning the next value to the already declared const variable.