title: How to populate a json array object dynamically?
body: <p>here is my code:</p>
  
  <pre><code>var pictures = {};
  
  for (var key in pics) {
      //just interested in the first 3 profile pictures.
      if (i &lt; 3){
          var view = Titanium.UI.createImageView({
              image: pics[key].source,    
              width: 'auto',    
              height: 'auto'
          });
  
          $.scrollableView.addView(view);
  
          //store in json object
          pictures['source'] = '[' + pics[key].source + ']';
  
          i++;
      } else {
          //break out of loop
          break;
      }
  }
  </code></pre>
  
  <p>Ok I know in JSON to create a JSON Array the syntax is basically this:</p>
  
  <pre><code>[ { something, something 2, something 3 }],
  </code></pre>
  
  <p>how can I create an json array dynamically based on the code above. </p>
  
  <pre><code>pictures['source'] = '[' + pics[key].source + ']';
  </code></pre>
  
  <p>This only stores the last <code>pics[key].source</code> in the list.</p>