title: Difficulty with loop and ajax
body: <p>I'm trying to do a check via ajax various elements of an array. However, I am unable to run the loop correctly. can you help me? </p>
  
  <p><a href="https://jsfiddle.net/mzpsLvo6/" rel="nofollow">https://jsfiddle.net/mzpsLvo6/</a></p>
  
  <pre><code>var codReferencia = ['1111','2222','3333','4444'];
  
  $.each(codReferencia, function(index, val) {
      $.ajax({
          url: "https://webapi.toqueacampainha.com.br/api/estoque/produtoprontaentrega?refid=" + codReferencia,
          dataType: 'json'
      })
      .done(function(data) {
          if ( data &gt;= '1' ) {
              console.log('do anything');
          } else {
              console.log('do not do anything');
          };
      });
  });
  </code></pre>