Skip to content

Commit 26f87f3

Browse files
committed
Reverse String
1 parent 742f089 commit 26f87f3

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Diff for: Reverse String.js

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*Write a function that takes a string as input and returns the string reversed.
2+
3+
Example:
4+
Given s = "hello", return "olleh".*/
5+
6+
/**
7+
* @param {string} s
8+
* @return {string}
9+
*/
10+
var reverseString = function(s) {
11+
return s.split('').reverse().join('')
12+
};

0 commit comments

Comments
 (0)