Pregunta de entrevista de Infosys

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