Starting at zero breaks when every value is negative.
Acceptance criteria
- 1.#out should show minus two.
Starting at zero breaks when every value is negative.
let best = 0; for (const n of [-5, -2, -9]) if (n > best) best = n; document.querySelector('#out').textContent = best === -2 ? "minus two" : "got " + best;
Output ready when you are
Press Run to render your code, or Submit to validate your solution.