Complete the code to remove the first element from the array.
let arr = [1, 2, 3, 4]; arr.[1](); console.log(arr);
The shift() method removes the first element from an array.
Complete the code to store and remove the first element from the array.
let arr = ['a', 'b', 'c']; let first = arr.[1](); console.log(first, arr);
shift() removes the first element and returns it, so first stores that element.
Fix the error in the code to remove the first element correctly.
let numbers = [10, 20, 30]; numbers.[1](0, 1); console.log(numbers);
splice(0, 1) removes one element starting at index 0, effectively removing the first element.
Fill both blanks to remove the first two elements from the array.
let fruits = ['apple', 'banana', 'cherry', 'date']; fruits.[1]([2], 2); console.log(fruits);
splice(0, 2) removes two elements starting at index 0, removing the first two fruits.
Fill all three blanks to create a new array without the first element.
let colors = ['red', 'green', 'blue']; let newColors = colors.[1]([2]); console.log(newColors);
slice(1) creates a new array starting from index 1, skipping the first element.
