CoStar Group interview question

Write code in JavaScript about how to reverse a name?