replace a value at a specific index inside an array in javascript code example
Example: javascript replace array element
array.splice(array.indexOf(valueToReplace), 1, newValue);
array.splice(array.indexOf(valueToReplace), 1, newValue);