Possible Duplicate:
How do I get the index of an item in an array?
search for element within an array
If I had an array like this:
var array = [
"one", //element 0
"two", //element 1
"three", //element 2
"four", //element 3
"five" //element 4
];
I want to look for a given part, let's say five.
So I ask the code to tell if five is inside array.
If it is, then it should tell me that it's position is 4, or array[4].
Is there any way I could achieve a similar effect?