What's the fastest way to find the index of an item in a list or object in Javascript / AS3? I'm asking this for both because the syntax is similar for both these languages.
Assuming:
myArray = ["one", "two", "three"];
myObject = {one:1, two:2, three:3};
Which is the fastest and in which case would you want it or not?
- Array.indexOf(x)
- myObject[x] != null
- x in myObject
- something else?