I don't know what is Array?

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 inside the square brackets, "Sachin", "Rohit", & "Tinkal" are elements of the array.


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.


Hi, I'm Shobhit Sharma

  • Facebook
  • Twitter
  • LinkedIn
  • Instagram

I'm a Software Engineer, Technology Writer & Researcher.

Check out 

GitHub-Mark-120px-plus.png

for Resources

Subscribe

Thanks for submitting!