Christopher T King <> writes:
....
> o = Array()
> o[0] = 5
> o[1] = 6
> o[2] = 7
> for (var i in o) print(i);
>
> should result in 0, 1, and 2 being printed. However, this is not the
> case: 5, 6, and 7 are instead printed.
Testing in a browser (changing "print" to "alert", since "print" will
print the page) gives me 0, 1 and 2.
What are you using for executing the code (browser/non-browser
environment)? Are you *sure* that is the code you are running?
> Am I missing something in the spec, is the implementation I'm using (njs)
> in error, or is this a discrepancy between JavaScript and ECMAScript?
JavaScript (the scripting language in Netscape browsers) and JScript
(the scripting language in IE) are both ECMAScript compatible, and
have been the last several versions.
/L
--
Lasse Reichstein Nielsen -
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'