Finding an objects place in an array

This is probably a n00b question. I have an object that when initialized takes a randomly selected value from an array. Is there a way to later determine the position of that randomly selected value in the array?
If the values in the array are unique, you can use a loop which starts at the beginning of the array and stops when finds an element with the value you are looking for ( or at the end of the array if the value wasn't found )
Yes for example the find() function returns the array index of the found element or the last array element if not found.
Ah, thanks! I solved, however, by storing the index in an integer value in the object, but the find() sounds a lot easier.
Topic archived. No new replies allowed.