views:

29

answers:

1

I'm using this piece of code to create a property map that I will pass to jQuery:

var myMap = {"one": 1, "two": 2, "three": 3};

However, this isn't complete. I want to iterate through a for loop and create a complex property map, that looks like this:

[...
{
  sleep: 2,
  fade: 1
}, [
  { src: 'sand-castle.jpeg' },
  { src: 'sunflower.jpeg'   },
  { src: 'flip-flops.jpeg'  },
  { src: 'rubber-ring.jpeg' }
]

I'm iterating through the list of files in the directory. How do I do this?

A: 
you can doo 
var _map=[];
var _prop={/*an object*/}
var _prop2={/*another object*/}

_map.push(_prop);
_map.push(_prop2);
Praveen Prasad