filter gives an array, but a single value is wanted.
Acceptance criteria
- 1.#out should show 8.
filter gives an array, but a single value is wanted.
const numbers = [1, 8, 3, 12]; const result = numbers.filter(n => n > 4); document.querySelector('#out').textContent = Array.isArray(result) ? "got an array" : result;
Output ready when you are
Press Run to render your code, or Submit to validate your solution.