1
1
1998or22020-04-30 17:33:33
JavaScript
1998or2, 2020-04-30 17:33:33

Script - Loop in JavaScript?

Help me create a loop, in js, that will iterate over the numbers from 0000 to 9999 adding +1 at each iteration.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WapSter, 2020-04-30
@1998or2

UPD did not pay attention to 4 digits

for (let i = 0; i <= 9999; i++) {
    console.log( String(i).padStart(4, '0') ) // спасибо @hzzzzl
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question