https://www.nogalis.com/wp-content/uploads/2020/01/Know-whats-in-your-Array.jpg 470 470 Angeli Menta https://www.nogalis.com/wp-content/uploads/2013/04/logo-with-slogan-good.png Angeli Menta2020-02-06 07:54:002020-02-04 16:28:11Know What’s in Your Array
Know What’s in Your Array
The indexOf() method returns the first index of where a user given element is found in an array or it returns -1. This method has 1 required parameter and 1 optional parameter. The required parameter is the lookup value and the optional one is start index. The lookup value is the element you are trying to find. The start index is where you want to start looking for the lookup value.
Below shows some examples of how the indexOf() method works.