Complete the code to add a new element at the end of the array.
let arr = [1, 2, 3]; arr.[1](4); console.log(arr);
The push method adds an element to the end of the array.
Complete the code to insert the number 10 at the end of the array.
const numbers = [5, 6, 7]; numbers.[1](10); console.log(numbers);
push adds the element 10 at the end of the array numbers.
Fix the error in the code to correctly add 'apple' at the end of the fruits array.
let fruits = ['banana', 'orange']; fruits.[1]('apple'); console.log(fruits);
The correct method to add an element at the end is push. Methods like remove or add do not exist for arrays.
Fill both blanks to add 100 at the end of the array and then print the updated array.
let data = [10, 20, 30]; data.[1](100); console.[2](data);
push adds 100 at the end of data. console.log prints the array.
Fill all three blanks to add 'end' to the array, store the new length, and print it.
let arr = ['start', 'middle']; let length = arr.[1]('end'); console.[2](length); console.[3](arr);
push adds 'end' and returns the new length. console.log prints the length and the updated array.
