Files
camperbot b3af21d50f chore(i18n,curriculum): update translations (#42487)
* chore(i18n,curriculum): update translations

* chore: Italian to italian

Co-authored-by: Nicholas Carrigan <nhcarrigan@gmail.com>
2021-06-14 11:34:20 -07:00

1.1 KiB

id, title, challengeType, forumTopicId, dashedName
id title challengeType forumTopicId dashedName
a202eed8fc186c8434cb6d61 Invertire una stringa 5 16043 reverse-a-string

--description--

Inverti la stringa fornita.

Potrebbe essere necessario trasformare la stringa in un array prima di poterla invertire.

Il tuo risultato deve essere una stringa.

--hints--

reverseString("hello") dovrebbe restituire una stringa.

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

reverseString("hello") dovrebbe restituire la stringa olleh.

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

reverseString("Howdy") dovrebbe restituire la stringa ydwoH.

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

reverseString("Greetings from Earth") dovrebbe restituire la stringa 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");