Pass the function itself
A callback is a function that another function calls.
your task
Give runCheck a function it can call. Each room’s three lines must start with “start”, “checking”, and “end”, in that order.
The starter prints the room’s check message before the runner starts. Then runCheck stops when it tries to call its second argument.
Run code runs your code once for each case. It compares what your code prints with the expected output.
Starter code
or press Ctrl EnterNot run yet
cases
Not run yetAtlas
Expected output
1
start Atlas2
checking Atlas3
end AtlasSee the input and the code for this case
const roomName = "Atlas";
function runCheck(name, body) {
console.log("start " + name);
body();
console.log("end " + name);
}Not run yetBirch
Expected output
1
start Birch2
checking Birch3
end BirchSee the input and the code for this case
const roomName = "Birch";
function runCheck(name, body) {
console.log("start " + name);
body();
console.log("end " + name);
}