In Firefox the output is ordered Alphabetically (which is the order they are declared). In IE and Chrome they are numerical. All latest versions.
Which is correct?
<html>
<head></head>
<body>
<script type="text/javascript">
function makeArray()
{
var array = [{5:'Five',4:'Four',1:'One',3:'Three',2:'Two'}];
var msg = '';
for (var val in array[0])
{
msg = msg + val;
}
alert(msg);
}
</script>
<input type="button" onClick="makeArray();" value="Press Me" />
</body>
</html>
Back Story... In SpiraTeam (Our current bug tracking system) many of the lists (users, modules, etc) are ordered using a similar format to the above. This makes finding stuff very hard and annoying unless you use FireFox. My interest is purely academical, I only ask because I want to know which browser's correct.