Question d’entretien chez Glassdoor

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