How to check the object property in javascript
<p>I have an array like below</p>

<pre><code>  var colorArray = ["#a", "#b", "#c", "#d", "#e"];
</code></pre>

<p>From this I will generate a map like this</p>

<pre><code>  function initilizeColorMap(){
    for(var i = 0 ;i &lt;colorArray.length ;i++){
    colorTrackingMap[i] = {value: colorArray [i],state:"unused"};
   }
 }
</code></pre>

<p>Hopw i can iterate through the map when  i need a color (next color from the map ) by checking the state  in javascript..?</p>
