user1739337
user1739337

Reputation: 113

Looping a section of Javascript a set number of time

What do I add at the beginning and end of a section of code to repeat it 36 times before going on?

Upvotes: 0

Views: 8817

Answers (3)

Kevin Boucher
Kevin Boucher

Reputation: 16675

You are looking for a for loop: https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Statements/for

Upvotes: 2

David G
David G

Reputation: 96810

You use a for loop:

for ( var i = 0; i < 36; i++ ) {
    // This will loop 36 times
}

Upvotes: 9

devdigital
devdigital

Reputation: 34349

You add a for loop:

 for (var i = 0; i < 36; i++) {
 }

Upvotes: 3

Related Questions