Skip to content

Commit aba6b84

Browse files
authored
Create recursive-string-reverse.js
1 parent 447090d commit aba6b84

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

recursive-string-reverse.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const reverseString = (str) => {
2+
if(str.length === 0){
3+
return "";
4+
}
5+
return reverseString(str.substr(1)) + str[0];
6+
}

0 commit comments

Comments
 (0)