Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Commit

Permalink
Add simple reverse function
Browse files Browse the repository at this point in the history
  • Loading branch information
sicktastic committed Nov 20, 2017
1 parent 727e1d7 commit cb5c71e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion algorithms/reversestring/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
// reverse('hello') === 'olleh'
// reverse('Greetings!') === '!sgniteerG'

function reverse(str) {}
function reverse(str) {
return str
.split('')
.reverse()
.join('')
}

module.exports = reverse;

0 comments on commit cb5c71e

Please sign in to comment.