Skip to content

Latest commit

 

History

History
11 lines (8 loc) · 300 Bytes

reverseString.md

File metadata and controls

11 lines (8 loc) · 300 Bytes

reverseString

Reverses 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('').

const reverseString = str => [...str].reverse().join('');
// reverseString('foobar') -> 'raboof'