forEach returns nothing, so the doubled values were lost.
Acceptance criteria
- 1.#out should show 2,4,6.
forEach returns nothing, so the doubled values were lost.
const numbers = [1, 2, 3]; const doubled = numbers.forEach(n => n * 2); document.querySelector('#out').textContent = doubled === undefined ? "nothing came back" : doubled.join(",");
Output ready when you are
Press Run to render your code, or Submit to validate your solution.