webmanz Posted June 19, 2018 Report Posted June 19, 2018 (edited) Difference between these two index? For ( index = 0; index < dogs.length; index + +); and indexOf Edited June 19, 2018 by webmanz
administrator Posted June 21, 2018 Report Posted June 21, 2018 indexOf is a function built into JavaScript that finds the position of a text in a string of text. In your example, index is just a variable.
martinsmith Posted October 9, 2020 Report Posted October 9, 2020 findIndex Returns the index of the first element in the array where predicate is true, and -1 otherwise. indexOf - Returns the index of the first occurrence of a value in an array
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now