Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript hot to sort letters

const sort = str => str.split('').sort((a, b) => a.localeCompare(b)).join('');

// Example:
sort('eat'); 
// Output:
// 'aet'
 
PREVIOUS NEXT
Tagged: #javascript #hot #sort #letters
ADD COMMENT
Topic
Name
2+2 =