Files
2021-02-16 14:21:30 -08:00

1.1 KiB

id, title, challengeType, forumTopicId, dashedName
id title challengeType forumTopicId dashedName
a202eed8fc186c8434cb6d61 Invertir una Cadena 5 16043 reverse-a-string

--description--

Invertir la cadena provista.

Es posible que necesites convertir la cadena en una matriz antes de poder invertirla.

Tu resultado deber ser una cadena.

--hints--

reverseString("hello") debería devolver una cadena.

assert(typeof reverseString('hello') === 'string');

reverseString("hello") debería convertirse en "olleh".

assert(reverseString('hello') === 'olleh');

reverseString("Howdy") debería convertirse en "ydwoH".

assert(reverseString('Howdy') === 'ydwoH');

reverseString("Greetings from Earth") debería devolver "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");