how to directly edit a value in an array javascript code example Example: modify array js let newArray = oldArray.map(funcToEachElem);