title: Nodejs proper mapping with array
body: <p>I don't know why i cant get all data of subject that relate from student, The only data that display on response is the last id of student model, I tried to put <strong>console.log(subject)</strong> and i get the desired result but i dont know why i cant display it on response</p>
  <pre><code>const results = {
       student: null,
       subject: null,
  }
  const student = await StudentModel.getById(id)
  if(student){
     for(let i = 0; i&lt;=student.length - 1; i++){
       subject=  await SubjectModel.getByStudentId(student[i]._id)
       console.log(subject)
       subject.append(subject)
       
     }
  }
  results.subject= subject
  res.json(data)
  </code></pre>
  <p>current result</p>
  <pre><code>student:[
     {
        id: 1,
        description: student 1
     },
     {
        id: 2,
        description: student 2
     }
  ],
  subject:[
     {
        studentid: 2,
        description: subject 2
     }
  ]
  </code></pre>
  <p>desired result</p>
  <p>result</p>
  <pre><code>student:[
     {
        id: 1,
        description: student 1
     },
     {
        id: 2,
        description: student 2
     }
  ],
  subject:[
     {
        studentid: 1,
        description: subject 1
     },
     {
        studentid: 2,
        description: subject 2
     }
  ]
  </code></pre>
  <p>Update when I tried to implement append i received this error</p>
  <p><em><strong>error: uncaughtException: subject.append is not a function</strong></em></p>