200k views
0 votes
Wrire a code that display elements at indices 1 and 4 in the follwoing array.

var userArray = [1, 6, 41, 8, 24, 4];

1 Answer

0 votes

Answer:

Console.log(userArray[1]);

Console.log(userArray[4]);

Step-by-step explanation:

The programming language was not stated; however, the variable declaration implies JavaScript.

JavaScript prints using the following syntax:

Console.log(print-name);

Since, the code is to print some elements of array userArray.

First, we need to determine the index of the elements.

The indices are given as 1 and 4.

So, the code to print these elements is as follows:

Console.log(userArray[1]);

Console.log(userArray[4]);

User Tippi
by
6.3k points