1

So I hava array Links and array Params with same langth N

So what I need is to create an object where for each link from Links I will be able to see param from Params

And than for example to be abble to call something like

for each( item in object) 
if (item.param == "some value") {
// some code
} else...

How to do such thing (Code exaMple, please)

1 Answer 1

1

From Array: You could first build a list with elements composed of a item and a param (supposing the length is indeed the same for both lists)

var items:Array = new Array();

for(var i:uint = 0; i < links.length; i++) {
   links:Array .push({link:links[i], param:params[i]});
}

You can then filter them easily:

items.forEach(checkValue);

for(var i:uint = 0; i < items.length; i++) {
  if (items[i].param == "some value") {
    // some code
  } else{
    ...
  }
}
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.