Skip to content

Instantly share code, notes, and snippets.

@jamc92
Created April 3, 2016 22:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamc92/3fedb093ced36bcf4f86776abc32be9a to your computer and use it in GitHub Desktop.
Save jamc92/3fedb093ced36bcf4f86776abc32be9a to your computer and use it in GitHub Desktop.
function reverseString(str) {
return str.split('').reverse().join('');
}
reverseString("hello", "");
@jamc92
Copy link
Author

jamc92 commented Apr 3, 2016

  • reverseString("hello") should return a string.
  • reverseString("hello") should become "olleh".
  • reverseString("Howdy") should become "ydwoH".
  • reverseString("Greetings from Earth") should return "htraE morf sgniteerG".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment