function removeItem(array, item) { for (let i = array.length; i ;) { if (array[--i] === item) array.splice(i, 1); } return array } const arr = [2, 5, 3, 5, 9, 5, 152]; console.log(removeItem(arr, 5))