You can always use either of the loops. But, the most common usage of for
loops is when the number of iterations are known, and the while
loop having uncertain number of iterations or would depend upon a particular condition. For example:
var arr = ["a", "b", "c"];
for (let i=0; i