Porting a match With Guards
Python’s match guards test conditions. A JavaScript switch compares its selector with each
case value using strict equality. Putting guests > 100 in a case under switch (guests)
compares a number with a Boolean, so Tom’s 120-guest booking reaches the default case and gets one caretaker.
For the Millbrook caretaker rules, use an else if chain in Python’s order. Test the missing
guest count first, then the larger threshold, then the smaller one. A return ends the
function as soon as its branch supplies the instruction.
Watch out: null and undefined are distinct values, and == null catches both a blank
guest count and a missing field.
This final function produces the caretaker instructions for the five fixed bookings.