Domanda di colloquio di Infosys

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