Rangle.io Interview Question

Write a recursive function in javascript on whiteboard. How to implement boilerplate functions.