EXERCISE · AlgoCasts

Reverse string

Given a string, return a new string with the reversed order of characters

3 testsAlgoCastsGPL-3.02 alternatesexercise 01 of 26

Directions

Directions

Given a string, return a new string with the reversed order of characters

Examples#

JS
reverse('apple') === 'leppa'reverse('hello') === 'olleh'reverse('Greetings!') === '!sgniteerG'

Try it first#

Copy the stub, make the 3 tests pass on your machine, then open the solution. The reveal is remembered per page in this browser.

JSexercises/reversestring/index.js
function reverse(str) {} module.exports = reverse;

See also