Konrad Group interview question

Read some JS, find the problems, and fix them