Skip to content

Instantly share code, notes, and snippets.

@bflannery
Last active December 19, 2016 23:54
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 bflannery/dc04ebbf7709feb2499338f5efa5967a to your computer and use it in GitHub Desktop.
Save bflannery/dc04ebbf7709feb2499338f5efa5967a to your computer and use it in GitHub Desktop.
Reverse String
// Reverse the provided string.
// You may need to turn the string into an array before you can reverse it.
// Your result must be a string.
function reverseString(str) {
var reverseStr = str.split('').reverse().join('');
return reverseStr;
}
console.log(reverseString("hello"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment