Files
2022-01-20 20:30:18 +01:00

1.2 KiB

id, title, challengeType, forumTopicId, dashedName
id title challengeType forumTopicId dashedName
a202eed8fc186c8434cb6d61 文字列の反転 5 16043 reverse-a-string

--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');

--seed--

--seed-contents--

function reverseString(str) {
  return str;
}

reverseString("hello");

--solutions--

function reverseString(str) {
  return str.split('').reverse().join('');
}

reverseString("hello");