An empty list: pass or fail

Decide what an empty result means for each check.

your task

Pass the room check only when it finds rooms and every room is free. Pass the warning check when every warning was seen, including when there are none. Print the rooms result first, then the warnings result.

The desk has free rooms, so an empty search result is a failure. The desk can also have no warnings. The starter gives the wrong result for both empty lists.

Starter code
or press Ctrl EnterNot run yet

cases

Not run yetTwo free rooms, no warnings

Expected output

1rooms: pass
2warnings: pass
See the input and the code for this case
const rooms = [{ name: "Atlas", free: true }, { name: "Birch", free: true }];
const warnings = [];
Not run yetNo rooms, one seen warning

Expected output

1rooms: fail
2warnings: pass
See the input and the code for this case
const rooms = [];
const warnings = [{ text: "Lift out of order", seen: true }];
Not run yetOne taken room, one unseen warning

Expected output

1rooms: fail
2warnings: fail
See the input and the code for this case
const rooms = [{ name: "Atlas", free: true }, { name: "Cedar", free: false }];
const warnings = [{ text: "Lift out of order", seen: true }, { text: "Fire drill at 10:00", seen: false }];