Anonymous interview question

Implementation of caurosal using javascript