GoConqr has a new look! Let us know what you think.

Module 5 of 18 · Media

Array Indexing

Kostas Diakogiannis

Array Indexing

Arrays index

Index number  is the system that is being used in order to retrieve or store information from and into an array. Initial index begins at 0 as in almost all programming languages. 

The syntax is simple: array[index] there. Where array is the variable's name or the array literally and the index the position of the element starting from 0.

In the example above if we want to print out the 'bring these mountains' value to the console we can specify the name and pass number 2 as the index inside the square brackets (this will print whatever lies at third position of the array!).

You can use the length property minus 1 if you want to get the last element of an array. 

Instructions

You must submit an attempt for this quiz to progress. You can submit it after the last question.

Go to the chosen module

Feedback

What is it about?

What do you think of the new look?

How do you like it?