Skip to content

Instantly share code, notes, and snippets.

@tdubs42
Last active February 19, 2024 01:31
Show Gist options
  • Save tdubs42/4e092fadf0d94ed836330c2025a069a6 to your computer and use it in GitHub Desktop.
Save tdubs42/4e092fadf0d94ed836330c2025a069a6 to your computer and use it in GitHub Desktop.
Reverse String - JavaScript
/*
This challenge is slightly misleading, as it says to reverse a string but inputs an array and expects an
array as output. If you need to return this as a string, use the String.join() method
*/
const reverseString = s => {
const reverseArray = s.reverse()
return reverseArray
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment