update snippets 0-All
This commit is contained in:
committed by
Agamemnon Zorbas
parent
6bedb8fba4
commit
0c129cdd02
@ -7,5 +7,8 @@ Split the string using `split('')`, `Array.sort()` utilizing `localeCompare()`,
|
||||
```js
|
||||
const sortCharactersInString = str =>
|
||||
str.split('').sort((a, b) => a.localeCompare(b)).join('');
|
||||
// sortCharactersInString('cabbage') -> 'aabbceg'
|
||||
```
|
||||
|
||||
```js
|
||||
sortCharactersInString('cabbage') -> 'aabbceg'
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user