// Create a function to do it easily and how many time you want!
const deleteFromArray = (array, value) => {
let newArray = array.filter(item => item !== value)
return newArray;
}
var array = [1, 2, 3, 4]
const newArr = deleteFromArray(array, 2)
console.log('Changed array:', newArr);
// Changed array: [ 1, 3, 4 ]