2018-10-16 21:32:40 +05:30

11 lines
298 B
Markdown

---
title: Iterate with JavaScript While Loops
---
Another type of JavaScript loop is called a `while loop` because it runs `while` something is true, and stops once that something is no longer true.
var ourArray = [];
var i = 0;
while(i < 5) {
ourArray.push(i);
i++;
}