About the For/In Statement
The for/in statement is used to execute a loop iteration for each property in an object. You might remember that an object is like a list except each element is given a name instead of an index number. For/in allows you to extract those property names dynamically.
This statement has the following format:
The following code displays the name and value of each property in the object named box:
Executing this code causes DScript to display the following text:
Note that the object properties are not extracted in the same order as they were defined. DScript stores properties inside an object in alphabetical order. So, a for/in statement always extracts properties in alphabetical order as well.