✨closure: manage grades
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
JS ⟩ value ⟩ function ⟩ closure ⟩ example ⟩ manage grades
replit:manage grades
// return a function (closure) that can add new grade.
function AddGrade(records) {
// • original grades are imported from `records`
// • record example : { id: 14, name: "Kyle", grade: 86 }
let grades = records.map(recordToGrade);
// ⭐ this function is returned
return function