mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-14 07:00:51 -04:00
1.2 KiB
1.2 KiB
id, title, challengeType, forumTopicId, dashedName
| id | title | challengeType | forumTopicId | dashedName |
|---|---|---|---|---|
| a202eed8fc186c8434cb6d61 | 文字列の反転 | 1 | 16043 | reverse-a-string |
--description--
与えられた文字列を反転させて、反転した文字列を返してください。
例えば、"hello" は "olleh" となるようにしてください。
--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');
--seed--
--seed-contents--
function reverseString(str) {
return str;
}
reverseString("hello");
--solutions--
function reverseString(str) {
return str.split('').reverse().join('');
}
reverseString("hello");