Complete the code to create an array with three numbers.
const numbers = [[1]];The correct way to create an array with three numbers is to separate them by commas inside square brackets.
Complete the code to access the first element of the array.
const first = numbers[1];Arrays are accessed using square brackets with the index inside. Indexing starts at 0.
Fix the error in the code to add a new element to the end of the array.
numbers.[1](4);
The correct method to add an element at the end of an array in JavaScript is push.
Fill both blanks to create an array of length 5 filled with zeros.
const zeros = new Array([1]).[2](0);
We create a new array of length 5 and fill it with zeros using the fill method.
Fill all three blanks to create an array of squares of numbers from 0 to 4.
const squares = Array.from({length: [1], (_, [2]) => [2] [3] 2);
We create an array of length 5, mapping each index x from 0 to 4 to its square using the exponent operator **.
