title: Making an object into an array of objects
body: <p>I have an object that contains an array and a couple of other values that I need to pass to the backend, but the backend needs to receive it as an array of objects. I fill in an array ($scope.student) by using checkboxes and the other values (docentid, vakid, klasid) by clicking on a field.</p>
  
  <p>The object with the array and values: </p>
  
  <pre><code>$scope.user = {
  studentid: [$scope.student],
  vakid: '',
  klasid: ''
  };
  </code></pre>
  
  <p>The mapping function:</p>
  
  <pre><code>var dataToSend = [$scope.user.studentid].map(function(s) { 
      return { 
          vakid: $scope.user.vakid, klasid: $scope.user.klasid, studentid: s 
      }; 
  });
  </code></pre>
  
  <p>Right now, when I log user, I see:</p>
  
  <pre><code>Object {studentid: Array[5], //Amount of results checked
  vakid: "Alfreds Futterkiste", 
  klasid: "Berlin"}
  </code></pre>
  
  <p>I would like to make it into an array of multiple objects, so every object will have the unique values of the array, vakid and klasid. The mapping function returns an empty array with vakid, klasid and studentid empty. </p>
  
  <p>What am I doing wrong?</p>