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

  • Home
  • SEARCH
  • 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: I changed/obfuscated some of the variable/table/column names here for security reasons. Please
DISCLAIMER: At my place of work we are aware that, as none of us
Disclaimer: Cocoa newbie here. I wrote an app with a Cocoa GUI that acts
(Disclaimer: I don't know what the C++ standard might say about this..I know, I'm
Disclaimer: I apologize if this is not an appropriate question to ask here... I
Disclaimer: I'm a total newbie at graph theory and I'm not sure if this
Disclaimer : I'm an SQL newb and this is for a class, but I
Disclaimer: I'm looking for a Python 2.6 solution, if there is one. I'm looking
Disclaimer: I have no experience in signing the files and this is my first
Disclaimer : This is a very basic question, but keep in mind I come

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.