webmanz Posted June 19, 2018 Report Share 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 Link to comment Share on other sites More sharing options...
administrator Posted June 21, 2018 Report Share 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 Link to comment Share on other sites More sharing options...
martinsmith Posted October 9, 2020 Report Share 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 Link to comment Share on other sites More sharing options...
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.