For exemple with a for loop
for (const i = 0; i < 100; i++) { // .... }
You can't useconst because I++ will increment i. But i is a constant. A constant can't change. So you have to use let
const
I++
i
let
I don't know all details for for of loop, just it uses Iterator. I found a good article about loops details : exploringjs.com/es6/ch_for-of.html
for of
Thanks 4 investing the time for helping me out amiceli
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
For exemple with a for loop
for (const i = 0; i < 100; i++) {
// ....
}
You can't use
constbecauseI++will incrementi.But
iis a constant. A constant can't change. So you have to useletI don't know all details for
for ofloop, just it uses Iterator. I found a good article about loops details : exploringjs.com/es6/ch_for-of.htmlThanks 4 investing the time for helping me out amiceli