Last active
August 9, 2017 14:50
-
-
Save jamessergeant/2737a34f9f0d509a25e68b4e8fb009e0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function makeStudentsReport(data) { | |
return data.map(function(student) { | |
return `${student.name}: ${student.grade}` | |
}) | |
} | |
function enrollInSummerSchool(students) { | |
return students.map(function(student) { | |
return { | |
name: student.name, | |
course: student.course, | |
status: 'In Summer school' | |
} | |
}); | |
} | |
function findById(items, idNum) { | |
return items.find(function(item) { | |
return (item.id === idNum) | |
}) | |
} | |
// BOOM! | |
function validateKeys(object, expectedKeys) { | |
return Object.keys(object).sort().join() === expectedKeys.sort().join(); | |
} | |
function makeToDos(owner, toDos) { | |
return { | |
owner: owner, | |
toDos: toDos, | |
generateHtml: function() { | |
return '<ul><li>' + toDos.join('</li><li>') + '</li></ul>'; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment