Please explain this. 

My understanding is with that it just won't error if leaveRoom is not a function, but we know it is. I defined it. And that function sends an error message if the user is not in a room.