IBM interview question

Basic JS question for prototype, closure, variable swapping