Skip to content

Instantly share code, notes, and snippets.

@Midoukh
Created January 5, 2021 17:36
Show Gist options
  • Save Midoukh/523cb8b41c274fe6a73c53689d961a60 to your computer and use it in GitHub Desktop.
Save Midoukh/523cb8b41c274fe6a73c53689d961a60 to your computer and use it in GitHub Desktop.
//recursion
function reverseString3(str){
if(!str){
return str
}else{
return reverseString3(str.slice(1)) + str[0] //ava Script + j then va Scriptj + a
}
}
console.log(reverseString3('Java Script'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment