Skip to content

Instantly share code, notes, and snippets.

@kamlekar
Created January 6, 2016 04:34
Show Gist options
  • Save kamlekar/97e0439ec7b0cc1a237b to your computer and use it in GitHub Desktop.
Save kamlekar/97e0439ec7b0cc1a237b to your computer and use it in GitHub Desktop.
String reverser
function rev(s){
var l = s.length, r=Array(l);
for(var i=l-1;i>=0;i--)
r[i]=s[l-1-i];
return r.join('');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment