title: How can I create an object with input values and push it to array?
body: <p>Let's say I have the following array in React:</p>
  <pre><code>const employees=[
      {
        id:1,
        firstName:'John',
        lastName:'Martinez'
      },
      {
          id:2,
          firstName:'Julio',
          lastName:'Mariella'
      }
  ]
  </code></pre>
  <p>I want to generate an array from user's input. For example user types their first name and last name in certain input fields and then these values are inserted into array and pushed to the employees object.</p>
  <p>I tried to insert array with:</p>
  <pre><code>employees.push(employee);
  </code></pre>
  <p>but that's not correct.</p>