DEV Community

Discussion on: The beauty of Functional Programming

Collapse
 
joaoportela profile image
João Paulo dos Santos Portela

There's just this a tiny little thing that you missed:

Where you have:

const numbers = [1, 2, 3];
const doubles = numbers.map(num => num * 2) //[1, 4, 6]

It should be:

const numbers = [1, 2, 3];
const doubles = numbers.map(num => num * 2) //[2, 4, 6]

(notice the comment change)