how to change an element in array code example
Example 1: javascript replace array element
array.splice(array.indexOf(valueToReplace), 1, newValue);
Example 2: js array modify element
people[0] = "Georgie";
array.splice(array.indexOf(valueToReplace), 1, newValue);
people[0] = "Georgie";