Lyft Interview Question

Asked to recreate a standard JavaScript function from scratch.