Answers for "javascript creata a function tha returns an array of strings sorted by length in ascending order"

3

sort array by string length javascript

function sortByLength(arr) {
   return arr.sort((x,y) => x.length - y.length);
}
Posted by: Guest on August-17-2020
2

javascript sorting array string by len

array.sort(function(a, b){return b.length - a.length});
Posted by: Guest on March-04-2020

Code answers related to "javascript creata a function tha returns an array of strings sorted by length in ascending order"

Code answers related to "Javascript"

Browse Popular Code Answers by Language