title: Parse array string to array object in Javascript
body: <p>I have a page method which returns a list of integers using <code>jQuery.ajax();</code>.</p>
  
  <pre><code>$.ajax({
      type: "POST",
      url: url,
      success: function (response) {
          console.log(typeof (response.d));
          console.log(response.d);
      }
  });
  </code></pre>
  
  <p><em><strong>This is the result in Console</em></strong></p>
  
  <pre><code>string
  [1767,3071,2744,1256,657,3374,3318,2518,3910,4107,2579,2997,1182,1260,32,3185,873,1374,35,858,3126,1911,3887,3053,298,3150,4222,2692,1397,707,3958,947,1315,4379,2265,2845,3123,3857,1140,1608,2317,2512,3280,1842,1930,4334,878,1366,522,1231]
  </code></pre>
  
  <p>I would like to stay away from trimming the square brackets and using split to then populate an array. </p>
  
  <p><em><strong>All I want is to be able to run</em></strong> </p>
  
  <pre><code>$.each(response.d, function() {
      console.log(this); // print each number in the array
  });
  </code></pre>
  
  <p><em><strong>But in my case it prints each character, not each number.</em></strong></p>
  
  <p><em>Here's the page method if anyone is curious</em></p>
  
  <pre><code>Random rnd = new Random();
  List&lt;int&gt; numbers = new List&lt;int&gt;();
  for(int i=0; i&lt;50; i++) {
      numbers.Add(rnd.Next(1000));
  }
  
  
  JavaScriptSerializer js = new JavaScriptSerializer();
  return js.Serialize(numbers);
  </code></pre>