Loops execute a block of code multiple times. JavaScript supports several loop types.
for — Known number of iterationswhile — While condition is truedo...while — Runs at least oncefor...of — Iterate over arrays/stringsfor...in — Iterate over object keysforEach() — Array method loopEdit the code below and click Run to see the result live.