fix naming
This commit is contained in:
9
snippets/reverse-string.md
Normal file
9
snippets/reverse-string.md
Normal file
@ -0,0 +1,9 @@
|
||||
### Reverse a string
|
||||
|
||||
Use array destructuring and `Array.reverse()` to reverse the order of the characters in the string.
|
||||
Combine characters to get a string using `join('')`.
|
||||
|
||||
```js
|
||||
const reverseString = str => [...str].reverse().join('');
|
||||
// reverseString('foobar') -> 'raboof'
|
||||
```
|
||||
Reference in New Issue
Block a user