Guest User

Untitled

a guest
Sep 19th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. function makeStudentsReport(data) {
  2. const results = []; // this makes an empty array
  3. for (let i = 0; i < data.length; i++) { //the loop which loops over each item in the array
  4. const item = data[i];//declared variable item to the item in array.
  5. results.push(`${item.name}: ${item.grade}`);//this adds each item to the end of the empty array that we created.
  6. }
  7. return results;
  8. }
Add Comment
Please, Sign In to add comment