title: Push data into array of objects using JavaScript
body: <p>I have an Array of Objects, once the user fill out and click on the button with id: <code>'add'</code>, I want to push this data into the first master.review.</p>
  
  <p>I tried with <code>push()</code> but I am getting 'list[0].review[j].push is not a function'.</p>
  
  <p>I did some research and I saw I should do like this:</p>
  
  <pre><code>list[0].review[j] = newData
  </code></pre>
  
  <p>But not even this one is working. Plus I want to add data all the time the user wants to add something.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>let list = [
  
    {
      master: "Leo",
      review: [{
          name: 'Bob',
          text: 'good'
        },
        {
          name: 'Elly',
          text: 'ok ok'
        },
  
      ]
  
    },
    {
      master: "Emily",
      review: [{
          name: 'Greg',
          text: 'omg!'
        },
        {
          name: 'Joe',
          text: 'SO so..'
        },
  
      ]
  
    },
  ]
  
  $('#add').on('click', function() {
  
    let name = document.getElementById('name').value;
    let text = document.getElementById('text').value;
  
    let newData = [{
      name: name,
      text: text,
    }]
  
  
    for (let i = 0; i &lt; list.length; i++) {
      for (let j = 0; j &lt; list[i].review.length; j++) {
        list[0].review[j].push(newData)
        console.log(list)
      }
  
    }
  
  })</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;input type="text" id="name" placeholder="Your Name" required/&gt;
  &lt;input type="text" id="text" placeholder="Your Name" required/&gt;
  &lt;input type="button" id="add" /&gt;</code></pre>
  </div>
  </div>
  </p>