2017-11-30 17:40:06 +02:00
2017-11-30 17:40:06 +02:00
2017-11-30 17:40:06 +02:00
2017-11-30 17:40:06 +02:00
2017-11-29 19:35:03 +02:00
2017-11-30 17:40:06 +02:00
2017-11-30 17:40:06 +02:00
2017-11-30 17:40:06 +02:00
2017-11-30 17:40:06 +02:00

Logo

30 seconds of code

Curated collection of useful Javascript snippets that you can understand in 30 seconds or less.

  • Use Ctrl + F or command + F to search for a snippet.
  • Contributions welcome, please read contribution guide.

Sort characters in string (alphabetical)

Split the string using split(''), sort() utilizing localeCompare(), recombine using join('').

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

Credits

Icons made by Smashicons from www.flaticon.com is licensed by CC 3.0 BY.

Languages
JavaScript 100%