splice() function must be called on the
arr array in order to remove 1 or more elements from the center of the array.
arr currently adds up to the value of 27. Simply remove as many elements from
arr, so the sum of the remaining elements is
Think about which group of consecutive elements you can remove so that the only elements left sum to 10.
Solution 1 (Click to Show/Hide)
const arr = [2, 4, 5, 1, 7, 5, 2, 1]; // only change code below this line arr.splice(1, 4); // only change code above this line console.log(arr);