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: number[] = [5, 6, 7]; numbers.[1](10); console.log(numbers);
The push method appends the element 10 to the end of the array.
Fix the error in the code to correctly add 'hello' at the end of the array.
let greetings = ['hi', 'hey']; greetings.[1]('hello'); console.log(greetings);
Using push adds 'hello' at the end of the array.
Fill both blanks to add 100 at the end and then print the array length.
let data = [10, 20, 30]; data.[1](100); console.log(data.[2]);
push adds 100 at the end, and length gives the array size.
Fill the blanks to add 'end' at the end, then remove the first element, and finally print the updated array.
let arr = ['start', 'middle']; arr.[1]('end'); arr.[2](); console.log(arr);
push adds 'end' at the end, shift removes the first element, and then printing arr shows the updated array.
