modify array js

JavaScript
let newArray = oldArray.map(funcToEachElem);
Source

Also in JavaScript: