The while Loop
Recreate the challenge from the lecture Looping Arrays, Breaking and Continuing, but this time using a
whileloop (call the arraypercentages3).Reflect on what solution you like better for this task: the
forloop or thewhileloop?
const percentages3 = [];
let i = 0;
while (i < populations.length) {
const perc = percentageOfWorld1(populations[i]);
percentages3.push(perc);
i++;
}
console.log(percentages3);