update snippets 0-All
This commit is contained in:
committed by
Agamemnon Zorbas
parent
39164e9cbf
commit
e7e687f60c
@ -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