. var elevator = elevators[0]; // Let's use the first elevator. [HOST]. 4. // Whenever the elevator is idle (has no more queued destinations) 6. 5.