title: Putting (pushing?) string data into an Array (or object) - jQuery
body: <p>I need some help with my code (clearly). So far I'm able to get the json data that I want but I can't seem to store it in a global array. My goal is to get data.count and data.url in an array like this:</p>
  
  <pre><code>var myHelpfulVariable = [
      // e.g. [data.count, '{label:' + data.url + '}']
      [3856, {label:'http://www.google.com/'}],
      [1897, {label:'http://www.yahoo.com/'}],
      [3870, {label:'http://www.microsoft.com/'}]
  ]
  </code></pre>
  
  <p>I've tried a few different methods using the push function all to no avail. Below is the code that gets the data but it doesn't attempt to put it into an array.</p>
  
  <p>Could someone please help? An explanation of why it works would also be helpful. Thanks in advance! </p>
  
  <pre><code>&lt;script src="jquery.min.js"&gt;&lt;/script&gt;
  &lt;script&gt;
  $(document).ready(function(){
  
      var getData = [
          'http://urls.api.twitter.com/1/urls/count.json?url=http://www.google.com&amp;callback=?',
          'http://urls.api.twitter.com/1/urls/count.json?url=http://www.yahoo.com/&amp;callback=?',
          'http://urls.api.twitter.com/1/urls/count.json?url=http://www.microsoft.com&amp;callback=?'
      ];
  
      $.each(getData, function(i,getValue) {
  
          var urlForGetJSONfunction = "'" + getValue + "'"    
  
          $.getJSON(getValue,  function(data) {
              $('&lt;div&gt;&lt;/div&gt;').append('&lt;strong&gt;' + data.count + '&lt;/strong&gt;' + ' retweets for: ' + '&lt;a href="' + data.url + '"&gt;' + data.url + '&lt;/a&gt;').appendTo('body')
  
  
              })//ends getJSON
  
      })//ends each loop
  });
  &lt;/script&gt;
  </code></pre>