Answers for "sort a string in alphabetical order javascript without using built in fun"

16

alphabetical order array javascript

arr.sort(function(a, b) {
    return a === b ? 0 : a < b ? -1 : 1;
  });
Posted by: Guest on August-11-2020
-1

javascript compare and sort strings alphabetically

function sortString(str){
  var arr = str.split('');
  var sorted = arr.sort();
  return sorted.join('');
}Copy
Posted by: Guest on February-29-2020

Code answers related to "sort a string in alphabetical order javascript without using built in fun"

Code answers related to "Javascript"

Browse Popular Code Answers by Language