title: How get values in Multidimensional Array in ajax request with jquery
body: <p>I return in a ajax call a multidimensional array and I need to get all values</p>
  
  <p>PhP</p>
  
  <pre><code>public function ExampleAction()
  {
  
   $arr = array(array("title" =&gt; 'Example Title 1',"description" =&gt; "Morbi leo risus, porta ac consectetur ac","datetime"=&gt;new \DateTime("tomorrow")),
                array("title" =&gt; 'Example Title 2',"description" =&gt; "Morbi leo risus, porta ac consectetur ac","datetime"=&gt;new \DateTime("today"))
      );
      return new JsonResponse(array(
          'data' =&gt;$arr,
          'success' =&gt; true), 200);
  }
  </code></pre>
  
  <p>For simple array I get the values like this in Javascript:</p>
  
  <pre><code>$.ajax({
   type: 'POST',
   url: Routing.generate('example'),
   data: {},
   dataType: 'json',
   success: function(response) {
     for (var key in response.data) {
  
       title= response.data[key]; 
       description= response.data[key];
       datetime= response.data[key]; 
  
     },          
    }
  })
  </code></pre>
  
  <p>But I do not know how to get it for multidimensional arrays. I have tried several ways and I have not succeeded. </p>
  
  <p>I appreciate your help in advance.</p>
  
  <p>Edited--------------------------Initial problem------------------------------</p>
  
  <p>I needed to obtain one object like this:</p>
  
  <pre><code>$.ajax({
  type: 'POST',
  url: Routing.generate('example'),
  data: {},
  dataType: 'json',
  success: function(response) {
  
    $('#calendar').eCalendar({
      ...
      events: [{
        title: 'Example Title 1', 
        description: 'Description 1. Without link', 
        datetime: new Date(2016, 11, 30) 
      },
      {
        title: 'Example Title 2', 
        description: 'Description 2.', 
        datetime: new Date(2016, 10, 23), 
      }]
    });
  }
  })
  </code></pre>
  
  <p>So I put the following:</p>
  
  <pre><code>$.ajax({
  type: 'POST',
  url: Routing.generate('example'),
  data: {},
  dataType: 'json',
  success: function(response) {
  
    $('#calendar').eCalendar({
      ....
      events: response.data,
      ....
  
    });
  }
  })
  </code></pre>
  
  <p>But this gave me the following error:</p>
  
  <pre><code>  TypeError: d.getDate is not a function
    if (d.getDate() == day &amp;&amp; d.getMonth() == dMonth &amp;&amp; d.getFullYear() == dYear) {...
  </code></pre>
  
  <p>I guess it's because of the way to get the date in php that does not give the same result as the one indicated in javascript. So I wanted to get the data with the ajax call and assign it manually, but I was assigning it to the object, so I was doing it wrong. How can I solve this problem?</p>