So the documentation has this nifty "in" operator which I like the idea of more that using a multiple step or statement (||). The documentation gives me this example.
trace("PI" in Math); // true
trace("myProperty" in Math); // false
and
public var myArray:Array = ["zero", "one", "two"];
trace(0 in myArray); // true
trace(1 in myArray); // true
trace("two" in myArray); // true
trace(3 in myArray); // false
So I try to use it like this:
var quickArray:Array = ["@icd9_color","@icd9_icd9","@templateIcd9_name","@templateIcd9_name","@templateIcd9_templateIcd9ID"];
return (element.dataField in quickArray);
Now I can trace or Alert.show() the element.datafield and it will match exactly with an array item, but it never returns true. Can anyone help me figure out why?
The only thing I can get to work this ugly thing:
return (
element.dataField == "@icd9_color" ||
element.dataField == "@icd9_icd9"
etc..
)