The guest who is not there
A guest lookup can finish without finding a booking.
your task
Print the room when the guest has a booking. Otherwise print “no booking for ” followed by the guest’s name.
The lookup prints Jonas’s room. For Tove, it stops while reading room. Both cases search bookings for the guest named in wanted.
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 yetJonas has a booking
Expected output
1
BirchSee the input and the code for this case
const bookings = [{ guest: "Mira", room: "Atlas" }, { guest: "Jonas", room: "Birch" }];
const wanted = "Jonas";Not run yetTove has no booking
Expected output
1
no booking for ToveSee the input and the code for this case
const bookings = [{ guest: "Mira", room: "Atlas" }, { guest: "Jonas", room: "Birch" }];
const wanted = "Tove";