--- id: a202eed8fc186c8434cb6d61 title: Reverse a String challengeType: 5 forumTopicId: 16043 --- ## Description
Reverse the provided string. You may need to turn the string into an array before you can reverse it. Your result must be a string.
## Instructions
## Tests
```yml tests: - text: reverseString("hello") should return a string. testString: assert(typeof reverseString("hello") === "string"); - text: reverseString("hello") should become "olleh". testString: assert(reverseString("hello") === "olleh"); - text: reverseString("Howdy") should become "ydwoH". testString: assert(reverseString("Howdy") === "ydwoH"); - text: reverseString("Greetings from Earth") should return "htraE morf sgniteerG". testString: assert(reverseString("Greetings from Earth") === "htraE morf sgniteerG"); ```
## Challenge Seed
```js function reverseString(str) { return str; } reverseString("hello"); ```
## Solution
```js function reverseString(str) { return str.split('').reverse().join(''); } reverseString("hello"); ```