How to accurately find the index of an entry in an array
There are many reasons you might need to access a certain piece of data from within a larger set, and you do that by referencing it's index.
We won't get into syntax now, but you should know that the first thing in an array is actually index 0.
This goes for strings and objects, too. All of these indices start at 0, so if you're looking asking the code to find indexArr[2], you're really going to get the third piece of information in that array.
❤️ Support for this channel comes from our friends at Scrimba – the coding platform that's reinvented interactive learning: https://scrimba.com/freecodecamp
Continue this lesson in the app
Install CourseHive on Android or iOS to keep learning while you move.