Question PRG-JS-0049
MediumWhat is the output of this program?
const arr = [1, 2, 3, 4, 5];
const r = arr.filter(x => x % 2).map(x => x * x).reduce((s, x) => s + x, 0);
console.log(r);
- A.
55
- B.
15
- C.
Sign up free to see the answer and a step-by-step explanation.