Skip to content

Trace the key name in an Array of Object

February 2, 2009
Not sure if this is the most optimal… Please comment if you find a better one.
var obj:Array = [ {key1:"value" },  {key2:"something" }, {key3:"whatever"}, {key4:23 }, {key5:05 } ];
for each(var i:Object in  obj) {   
   for (var j:String in i) {
      trace(j); // key1, key2, key3, key4, key5
   }
}
Advertisements

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: