Complete the code to add the number 5 to the end of the array.
numbers = [1, 2, 3, 4] numbers.[1](5) puts numbers.inspect
The push method adds an element to the end of the array.
Complete the code to remove the first element from the array.
fruits = ['apple', 'banana', 'cherry'] removed = fruits.[1]() puts removed puts fruits.inspect
The shift method removes and returns the first element of the array.
Fix the error in the code to add 'orange' to the beginning of the array.
colors = ['red', 'green', 'blue'] colors.[1]('orange') puts colors.inspect
The unshift method adds an element to the beginning of the array.
Fill both blanks to remove the last element and add 'kiwi' to the beginning of the array.
basket = ['apple', 'banana', 'cherry'] basket.[1]() basket.[2]('kiwi') puts basket.inspect
pop removes the last element, and unshift adds an element to the beginning.
Fill all three blanks to add 10 to the end, remove the first element, and add 5 to the beginning of the array.
nums = [1, 2, 3] nums.[1](10) removed = nums.[2]() nums.[3](5) puts nums.inspect puts removed
push adds to the end, shift removes the first element, and unshift adds to the beginning.
