Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function makeStudentsReport(data) {
- const results = []; // this makes an empty array
- for (let i = 0; i < data.length; i++) { //the loop which loops over each item in the array
- const item = data[i];//declared variable item to the item in array.
- results.push(`${item.name}: ${item.grade}`);//this adds each item to the end of the empty array that we created.
- }
- return results;
- }
Add Comment
Please, Sign In to add comment