The previous lesson returned a function. Now pass one into repeatAction to collect three results. Run script.js and inspect the Console.
A callback is a function passed into another function. Instead of only describing that idea, this lesson makes the callback run three times and shows the collected results.
function repeatNotice(times, callback) {
for (let index = 0; index < times; index++) callback(index);
}
repeatNotice(3, (index) => console.log(`Subscriber ${index + 1}`));
repeatAction(callback) so it invokes the callback exactly three times.runs values as a standalone run,run,run line.Call the callback three times inside repeatAction.
Use an array like runs to collect each callback result.