es6 change array value code example Example: modify array js let newArray = oldArray.map(funcToEachElem);