Skip to content

Instantly share code, notes, and snippets.

@erictleung
Created November 17, 2015 01:59
Show Gist options
  • Save erictleung/3549691fc1bf63abf26a to your computer and use it in GitHub Desktop.
Save erictleung/3549691fc1bf63abf26a to your computer and use it in GitHub Desktop.
Function to return a given string but in reverse
// Bonfire: Reverse a String
// Author: @erictleung
// Challenge: http://www.freecodecamp.com/challenges/bonfire-reverse-a-string
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function reverseString(str) {
return str.split("").reverse().join("");
}
reverseString("hello");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment