title: jQuery / Ajax: How to loop through array as part of Ajax success function
body: <p>I have an <strong>Ajax call</strong> that returns an array and need to do something with each of the values from this array. </p>
  
  <p><strong>So far I have the below but this returns the following error:</strong>  </p>
  
  <pre><code>Uncaught TypeError: Cannot use 'in' operator to search for 'length' in array(5)...
  </code></pre>
  
  <p>Can someone tell me what I am doing wrong here resp. how I can do something with each of the values ?</p>
  
  <p><strong>My Ajax:</strong> </p>
  
  <pre><code>$.ajax({        
      type: "post",   
      url: "ajax.php",
      cache: "false",
      data: {
          node: 'fetchValues',
          itemIDs: itemIDs
      },
      success: function(data){
          console.log(data);  // for testing only
          jQuery.each(data, function(index, value){
              console.log(value);
          });
      }
  });
  </code></pre>
  
  <p><strong>Example for "data"</strong> (from console log)<strong>:</strong></p>
  
  <pre><code>array(5) {
    [1]=&gt;
    string(6) "Value1"
    [2]=&gt;
    string(6) "Value2"
    [3]=&gt;
    string(6) "Value3"
    [4]=&gt;
    string(6) "Value4"
    [5]=&gt;
    string(6) "Value5"
  }
  </code></pre>
  
  <p>Many thanks in advance for any help. </p>