title: How to create an empty object similar to an object from a array of objects in AngularJS?
body: <p>I have the following array of objects:</p>
  
  <pre><code>$scope.users = [
      {
          ID: "1",
          Name: "Hege",
          Username: "Pege",
          Password: "hp",
      },
      {
          ID: "2",
          Name: "Peter",
          Username: "Pan",
          Password: "pp"
      }
  ];
  </code></pre>
  
  <p>I need to create a similar object with empty values like this,</p>
  
  <pre><code>$scope.newUser = {
      ID: "",
      Name: "",
      Username: "",
      Password: ""
  }
  </code></pre>
  
  <p>so that I can push it to the same array (<code>$scope.users.push($scope.newUser);</code>), to get it look something like this:</p>
  
  <pre><code>$scope.users = [
      {
          ID: "1",
          Name: "Hege",
          Username: "Pege",
          Password: "hp"
      },
      {
          ID: "2",
          Name: "Peter",
          Username: "Pan",
          Password: "pp"
      },
      {
          ID: "",
          Name: "",
          Username: "",
          Password: ""
      }
  ];
  </code></pre>
  
  <p>However, the array <code>$scope.users</code> will not always have the array of same objects. I need it to work even if I change the array to something different, for example, like this: </p>
  
  <pre><code>$scope.users = [
      {
          SID: "pepe",
          Name: "Peter",
          School: "Primary School"
      },
      {
          SID: "hepe",
          Name: "Hege",
          School: "Junior School"
      }
  ];
  </code></pre>
  
  <p>How can I do this?</p>