ICON interview question

Writing a recursive Javascript question.