--- id: a202eed8fc186c8434cb6d61 challengeType: 5 videoUrl: '' title: 反转字符串 --- ## Description
反转提供的字符串。您可能需要先将字符串转换为数组,然后才能将其反转。您的结果必须是字符串。如果卡住,请记得使用Read-Search-Ask 。编写自己的代码。
## Instructions
## Tests
```yml tests: - text: reverseString("hello")应该返回一个字符串。 testString: assert(typeof reverseString("hello") === "string"); - text: reverseString("hello")应该变成"olleh" 。 testString: assert(reverseString("hello") === "olleh"); - text: reverseString("Howdy")应该变成"ydwoH" 。 testString: assert(reverseString("Howdy") === "ydwoH"); - text: reverseString("Greetings from Earth")应返回"htraE morf sgniteerG" 。 testString: assert(reverseString("Greetings from Earth") === "htraE morf sgniteerG"); ```
## Challenge Seed
```js function reverseString(str) { return str; } reverseString("hello"); ```
## Solution
```js // solution required ``` /section>