I recently read a tutorial on CSS browser feature detection... The end product was something like this...
var prefix = [\'Moz\', \'webkit\', \'O\', \'ms\', \'Kht
The statement if (foo in bar) tests whether the object bar has a property named foo. It doesn't test for a property with the value foo.
That is:
var bar = {"a" : "x", "b" : "y"};
alert("a" in bar); // true
alert("x" in bar); // false
You can use this syntax on arrays because they are a type of object. If bar is an array then foo in bar will be true if foo is either a numeric index of the array that has a value or if foo is some other property or method name.
Also, if this is used to check values in an array HOW is
test_style = document.createElement('div').stylean array?
test_style is an object, not an array.