title: Print json array in JS
body: <p>I'm trying to print in browser console with JS my JSON response from PHP.
  I saw many posts here and at another sites, but I can't do it.</p>
  
  <p>I have a JSON like that</p>
  
  <pre><code>{"0":{"codigo_intervencao":"Apoio Emocional - 5270"},"1":{"tempo":"30"},"2":{"codigo_intervencao":"Apoio Emocional - 5270"},"3":{"tempo":"30"},"4":{"codigo_intervencao":"Apoio Emocional - 5270"},"5":{"tempo":"231518"},"6":{"codigo_intervencao":"Apoio Emocional - 5270"}}
  </code></pre>
  
  <p>I want to print in console, for example, each value of the key "codigo_intervencao", but I cannot achieve that.</p>
  
  <p>I've tried something like that:</p>
  
  <pre><code>$(document).ready(function() {
  
    $( "#target" ).click(function() {
      console.log("Select JS");
        $.ajax({
          type: "POST",
          url: "select.php",
          dataType: 'html',
          success: function(response) {
              console.log("Response:" + response); // Here it prints above json
              var array = $.parseJSON(response);
              var tempo = 0;
              var arrayLength = array.length;
  
              for (var i = 0; i &lt; arrayLength; i++) {
                console.log(array[i]['codigo_intervencao']);
  
          }
        });
    });
  }); 
  </code></pre>