title: set jquery multidimensional array
body: <p>I'm getting attribute values. I need to set into multidimensional array but it's showing error. where im getting wrong ?</p>
  
  <pre><code>var myArray = [];
  amount=10;
  x=1
  $(id).closest('td').nextAll().find('input').each(function (n) {
  
          myArray[x]['id'] = $(this).attr('data-id');
          myArray[x]['year'] = $(this).attr('data-year');
          myArray[x]['month'] = $(this).attr('data-month');
          myArray[x]['amount'] = amount;
  
          x++;
  });
  console.log(myArray);
  </code></pre>