-
Notifications
You must be signed in to change notification settings - Fork 0
Looping
SimonPlanje edited this page Jun 21, 2020
·
3 revisions
function howMany(selectObject) {
let numberSelected = 0;
for (let i = 0; i < selectObject.options.length; i++) {
if (selectObject.options[i].selected) {
numberSelected++;
}
}
return numberSelected;
}
let i = 0;
do {
i += 1;
console.log(i);
} while (i < 5);
let n = 0;
let x = 0;
while (n < 3) {
n++;
x += n;
}
- MDN contributors. (2020, 30 januari). Loops and iteration. MDN Web Docs. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Loops_and_iteration
Simon Planje 20/06/2020
