Pergunta de entrevista da empresa Bright Data

First home assignment with 2 google docs question: 1) check for input if palindrome 2) simplify a code of 30 lines into 5 lines in native JS