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 Quote
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. Quote
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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.