Pergunta de entrevista da empresa Glassdoor

Create a sort function in JavaScript that takes user input and sorts them by moving the fields