ICON Interview Question

Writing a recursive Javascript question.