title: Stringify a multi-dimension array with javascript
body: <p>Im creating an invoice for books, and aim to submit it via ajax. Im trying to json encode the array of books in the invoice, however I keep getting a blank value</p>
  
  <pre><code> //create item list
      var order_items = [];
      $('#mi_books tbody tr.userbooks').each(function(index)
      {
          var bookisbn = $(this).find('td .mi_isbn').text();
  
          var bookdata = [];
          bookdata['isbn'] = bookisbn;
          bookdata['title'] = $(this).find('.mi_title').text();
          bookdata['qty'] = $(this).find('.mi_qty').text();
          bookdata['price'] = $(this).find('.mi_price').text();
  
          order_items.push(bookdata);
  
      });
      alert(JSON.stringify(order_items));
      alert(order_items.toString());
      console.log(order_items);
  </code></pre>
  
  <p><code>alert(JSON.stringify(order_items));</code><br>
  Outputs: <code>[[]]</code></p>
  
  <p><code>alert(order_items.toString());</code><br>
  Outputs:  <code>blank</code></p>
  
  <p><code>console.log(order_items);</code><br>
  Output:</p>
  
  <pre class="lang-none prettyprint-override"><code>Array[1]
  0: Array[0]
  isbn: "9781401216672"
  length: 0
  price: "1007"
  qty: "1"
  title: "Batman: The Killing Joke"
  __proto__: Array[0]
  length: 1
  __proto__: Array[0]
  </code></pre>
  
  <p>My array is being created, but somehow I cant seem to json encode it? Am I doing something wrong?</p>