Pergunta de entrevista da empresa CoStar Group

Write code in JavaScript about how to reverse a name?