remove many element of arrary and replace with a single value code example
Example: javascript replace array element
array.splice(array.indexOf(valueToReplace), 1, newValue);
array.splice(array.indexOf(valueToReplace), 1, newValue);