Skip to content

Instantly share code, notes, and snippets.

@Angelfire
Created October 17, 2018 01:45
Show Gist options
  • Save Angelfire/e788586b7edaa0f67cd346df542725b7 to your computer and use it in GitHub Desktop.
Save Angelfire/e788586b7edaa0f67cd346df542725b7 to your computer and use it in GitHub Desktop.
Reverse string
/**
Challenge
Using the JavaScript language, have the function FirstReverse(str) take the str parameter being passed and return the string in reversed order. For example: if the input string is "Hello World and Coders" then your program should return the string sredoC dna dlroW olleH.
Sample Test Cases
Input:"coderbyte"
Output:"etybredoc"
Input:"I Love Code"
Output:"edoC evoL I"
*/
function FirstReverse(str) {
return str.split('').reverse().join('');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment