How to apply function to every array element in JavaScript

Functions
Last updated Dec 19, 2017
const ages = [18, 20, 21, 30];

const agesPlusOne = ages.map(age => age + 1);
[19, 21, 22, 31]