I need to write a function that will delete the number or item entered in the input box. Heres what I have so far...
const my_arr = [1, 2, 3, 9]
function my_set_remove(my_arr, value) {
let result = [];
for (let i = 0; i < my_arr.length; i++) {
result = my_arr[i];
if (my_arr[i] == value) {
let new_arr = my_arr.pop[i];
return new_arr;
}
}
}
console.log(my_set_remove(my_arr, 9));
When I console.log it says undefined. Thanks in advance for your help