mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2025-12-30 21:03:58 -05:00
798 B
798 B
id, title, challengeType, forumTopicId
| id | title | challengeType | forumTopicId |
|---|---|---|---|
| a202eed8fc186c8434cb6d61 | 反转字符串 | 5 | 16043 |
--description--
请反转传入函数的字符串。
在反转字符串之前,你可能需要将其切分成包含字符的数组。
函数的返回结果应为字符串。
--hints--
reverseString("hello") 应返回一个字符串。
assert(typeof reverseString('hello') === 'string');
reverseString("hello") 应返回 "olleh"。
assert(reverseString('hello') === 'olleh');
reverseString("Howdy") 应返回 "ydwoH"。
assert(reverseString('Howdy') === 'ydwoH');
reverseString("Greetings from Earth") 应返回 "htraE morf sgniteerG"。
assert(reverseString('Greetings from Earth') === 'htraE morf sgniteerG');