How to apply function to every array element in JavaScript

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

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