Archive, multitagging, cleanup

Cleaned up the current snippets for consistency and minor problems, added multiple tags to most of them, archived a few.
This commit is contained in:
Angelos Chalaris
2018-01-05 16:33:54 +02:00
parent 20b018359b
commit 931e9c689f
55 changed files with 2650 additions and 2682 deletions

View File

@ -2,12 +2,11 @@
Alphabetically sorts the characters in a string.
Split the string using `split('')`, `Array.sort()` utilizing `localeCompare()`, recombine using `join('')`.
Use the spread operator (`...`), `Array.sort()` and `String.localeCompare()` to sort the characters in `str`, recombine using `String.join('')`.
```js
const sortCharactersInString = str =>
str
.split('')
[...str]
.sort((a, b) => a.localeCompare(b))
.join('');
```