DEV Community

Cover image for Day 5 of JavaScriptmas - Reverse String Solution
Sekti Wicaksono
Sekti Wicaksono

Posted on

1

Day 5 of JavaScriptmas - Reverse String Solution

Day 5 is Reverse string. The classic problem to reverse string.

For instance string 'Hello' reversed into 'olleH'.
Since a string can be split into array, we can reverse the arrangement of array with reverse and concat the array with join to reverse it back into single string.

There is JavaScript solution

function reverseAString(str) {
    return str.split('').reverse().join('');
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more