๐๐ฎ๐๐ฎ๐ฆ๐ฐ๐ฟ๐ถ๐ฝ๐ ๐๐ผ๐ผ๐ฝ๐: ๐๐ผ๐ฟ ๐๐ ๐๐ผ ๐ช๐ต๐ถ๐น๐ฒ
You need to run code multiple times. Loops do this work for you.
The For Loop Use this loop when you know the count. It uses three parts.
- Part one sets the start value.
- Part two checks a condition.
- Part three updates the value.
All three parts are optional. Skip the condition and the loop runs forever. This crashes your browser. Use a break statement to stop it.
The Do While Loop This loop runs the code first. It checks the condition second. Your code runs at least once. The loop stops when the condition is false.
Source: https://www.w3schools.com/js/js_loop_while.asp Optional learning community: https://dev.to/madhanraj/for-loop-and-do-while-loop-in-javascript-4i8b