9 lines
244 B
Markdown
9 lines
244 B
Markdown
### 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('');
|
|
```
|