Guest practice: this set is not saved and does not count.
What does this log?
const pets = ["cat", "dog"]; for (const p in pets) { console.log(p); }
0
1
2
cat
dog
let count = 0; for (let a = 0; a < 3; a++) { for (let b = 0; b < 4; b++) { count++; } } console.log(count);
for (let row = 1; row <= 2; row++) { for (let col = 1; col <= 3; col++) { if (col === 2) break; console.log(row + "," + col); } }
1,1
1,2
1,3
2,1
const amounts = [5, 0, 10, -1, 20]; let total = 0; for (const a of amounts) { if (a === 0) continue; if (a < 0) break; total += a; } console.log(total);
function firstBig(nums) { for (const n of nums) { if (n > 10) return n; } return null; } console.log(firstBig([3, 12, 40]));
Click a question to go back and check it. After you submit, you will see the right answer and an explanation for every question. As a guest, nothing is saved.
Check my answers