Jump to content
Killersites Community
Sign in to follow this  
webmanz

Difference between IndexOf and index =

Recommended Posts

Difference between these two index?

 

For ( index = 0; index < dogs.length; index + +);

and

indexOf

 

Edited by webmanz

Share this post


Link to post
Share on other sites

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. 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×