Question d’entretien chez Infosys

How to sort an array in JavaScript and to calculate it’s length.