Skip to content

Instantly share code, notes, and snippets.

@eccstartup
Created June 27, 2014 13:04
Show Gist options
  • Save eccstartup/93d72674a1d9b72b9cb8 to your computer and use it in GitHub Desktop.
Save eccstartup/93d72674a1d9b72b9cb8 to your computer and use it in GitHub Desktop.
js function to reverse a string
var reverse = function(str){
if (str.length==0){
return str;
}
else{
return reverse(str.substring(1))+str[0];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment