In Javascript is it possible to check whether a string occurs in an array by using the "in" operator?
For eg:
var moveAnims = new Array("fly", "wipe", "flip", "cube");
alert("wipe" in moveAnims);
alert("fly " in moveAnims);
alert("fly" in moveAnims);
alert("Cube" in moveAnims);
Or is the ONLY way to do it iteratively?
var moveAnims = new Array("fly", "wipe", "flip", "cube");
var targets = new Array("wipe", "fly ", "fly", "Cube");
for (var i=0; i<moveAnims.length; i++)
{
for (var j=0; j<targets.length; j++)
if (targets[j] == moveAnims[i])
alert("Found "+targets[j]);
}