for in gives the index, so the totals are wrong.
Acceptance criteria
- 1.#out should show 100.
for in gives the index, so the totals are wrong.
const numbers = [10, 20, 30, 40]; let total = 0; for (const number in numbers) { total += Number(number); } document.querySelector('#out').textContent = total;
Output ready when you are
Press Run to render your code, or Submit to validate your solution.