Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 509079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:58:24+00:00 2026-05-13T06:58:24+00:00

DISCLAIMER: relatively new to Flex/AS3, I might be missing something obvious. After doing some

  • 0

DISCLAIMER: relatively new to Flex/AS3, I might be missing something obvious.

After doing some research it appears that using the for(var property:String in object) does not guarantee the enumeration order of properties, however it doesn’t say anything about modifying the VALUE that property points to as changing the for…in loop. See For-Each Loop AS3: Is the direction guaranteed? for background info.

My example is as follows:

for(var i:int = 0; i<objectArray.length; i++)
{
    for(var property:String in objectArray[i])
    {
        objectArray[i][property] = unescape(objectArray[i][property]);
    }
}

objectArray[i] has properties a, b, c, d, e, f. When I step through the code here I get c, b, d, c, a, f. Notice that I get c twice.

As a solution I can create a temp object to store the data while doing the loop on the original object, and then replace the original object with the modified data, but I’d like to know what exactly is going on.

So my question is, does the value of object property modify the looping order of the for…in construct? And if so, should it or is this a bug?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T06:58:24+00:00Added an answer on May 13, 2026 at 6:58 am

    Altering the contents of a variable you are looping over is rarely a good thing to do.
    In Java for example you can’t iterate over a thing you are modifying.

    You should produce a copy, work on the copy and after the loop is over re-assign the new data to the variable in a single instruction.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Disclaimer: the following is a sin against XML. That's why I'm trying to change
Disclaimer: I'm fairly new to python! If I want all the lines of a
Disclaimer Yes, I am fully aware that what I am asking about is totally
DISCLAIMER: The following code is not something I would ever use in a real
Before I start a disclaimer, I should add a little disclaimer, that I am
Disclaimer: I'm pretty new to DDD and its associated terminology, so if i'm mislabeling
Disclaimer: This is not actually a programming question, but I feel the audience on
Disclaimer: I'm stuck on TFS and I hate it. My source control structure looks
Disclaimer: This is for a homework assignment, but the question is not regarding the
Disclaimer This is not strictly a programming question, but most programmers soon or later

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.