JavaScript Professional — Medium
Key points
- The reduce method is used to iterate over the array and accumulate values
- The ternary operator checks if the number is even before multiplying by 2
- The initial value of the accumulator is an empty array
Ready to go further?
Related questions
