title: How to create a multidimensional array with JQuery -with .each()
body: <p>I would like to create the following array with Jquery and a .each function:</p>
  
  <p>I would like the JSON to look like <strong>this:</strong></p>
  
  <pre><code>{
              "calendar_id": "1",
              "dishs": [
                   {
                      "dish_id": "11111",
                      "amount": "234234"
                  },
                   {
                      "dish_id": "11112",
                      "amount": "234234"
                  },
                   {
                      "dish_id": "11113",
                      "amount": "234234"
                  }, ...]
  }
  </code></pre>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;input type="number" class="amount" id="amount_14793"&gt;
  &lt;input type="number" class="amount" id="amount_14794"&gt;
  &lt;input type="number" class="amount" id="amount_14795"&gt;
  </code></pre>
  
  <p><code>dish_id</code> is the id (i.e. amount_14794)
  <code>amount</code> is the <code>val()</code> of that input.</p>
  
  <p>Please note that <code>calendar_id</code> appears once in the beginning of the array.</p>