Sabre interview question

Tricky Ruby and Javascript questions.