FOR IN Loop

When I use a FOR IN loop I expect to loop throught the items in the order that they were created, but this does not seem the case.

var _obj_tables = null;

function onShow(firstShow, event) {
	if(firstShow) {
		_obj_tables = new Object()
		_obj_tables.calls = new Array()
		_obj_tables.tasks = new Array()
		_obj_tables.consumers = new Array()
		_obj_tables.relations = new Array()
		_obj_tables.suppliers = new Array()
		_obj_tables.employees = new Array()
	}
}

function onAction(event) {
	for(i in _obj_tables) {
		application.output(i);
	}
}

I would expect to see the following result:
calls
tasks
consumers
relations
suppliers
employees

But I get the items in the following order:
tasks
employees
consumers
calls
suppliers
relations

Why is this?

You’re creating a javascript object and by definition properties of a javascript object are unordered. So you can’t count on a certain order in FOR IN loop, because this will be Javascript engine implementation depended.