CoStar Group Interview Question

Write code in JavaScript about how to reverse a name?