top of page

Subscribe my newsletter for engineering insights, news, and developments @ The Engineering ApeX 

What is Array? - Let's take it easy

Updated: Jan 22, 2023

The array is the foundational Data Structure and a list of elements.

Let's take an example:

Prashant says, he has 3 friends, and their names are Sachin, Rohit, & Tinkal.

Can we say it's a list? Yes, we can make a list of Prashant's friends.

friendsOfPrashant = ['Sachin', 'Rohit', 'Tinkal']

Basically, Prashant did nothing here but created a fancy list of his friends.

So, the friendsOfPrashant is an array, and, "Sachin", "Rohit", & "Tinkal" inside the square brackets are elements of the array.

TASK: Can you make your own array example? Let's do it, it's fun and you'll learn it more accurately. Create one here.

In most programming languages, the counts of the elements in the array begin with 0. So, for our example array friendsOfPrashant, the elements "Sachin" is at index 0, "Rohit" is at 1 & "Tinkal" is at 2.

The index of an array is the number that identifies where a piece of data lives inside the array.

bottom of page