1.1 KiB
1.1 KiB
id, title, challengeType, forumTopicId, dashedName
id | title | challengeType | forumTopicId | dashedName |
---|---|---|---|---|
a202eed8fc186c8434cb6d61 | Invierte una cadena | 5 | 16043 | reverse-a-string |
--description--
Invierte la cadena proporcionada.
Es posible que necesites convertir la cadena en un arreglo antes de poder invertirla.
Tu resultado debe ser una cadena.
--hints--
reverseString("hello")
debe devolver una cadena.
assert(typeof reverseString('hello') === 'string');
reverseString("hello")
debe devolver la cadena olleh
.
assert(reverseString('hello') === 'olleh');
reverseString("Howdy")
debe devolver la cadena ydwoH
.
assert(reverseString('Howdy') === 'ydwoH');
reverseString("Greetings from Earth")
debe devolver la cadena 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");