Here is some output from the console that illustrates my question
var a=document.createElement("select"); <ENTER>
undefined
a.appendChild(document.createElement("option")); <ENTER>
<option></option>
a
<select>…</select>
a.options
[<option></option>]
a.options[0];
<option></option>
So far, so good. But now
I type a.options.
and I am to type forEach but I notice forEach isn't getting listed.
a.options.forEach(function() {});
VM1048:2 Uncaught TypeError: a.options.forEach is not a function
at <anonymous>:2:11
at Object.InjectedScript._evaluateOn (<anonymous>:905:140)
at Object.InjectedScript._evaluateAndWrap (<anonymous>:838:34)
at Object.InjectedScript.evaluate (<anonymous>:694:21)
Yet a.options so looked like an array
And forEach definitely works for arrays, no error.
a=[1,2];
[1, 2]
typeof a
"object"
a.forEach(function(){});
undefined
I guess the options of a selection box maybe aren't an array.. so what are they?
I've heard of the 'arguments' pseudo-array.. I guess perhaps a selection box's 'options' is like that? / some object that has similar syntax to array?