Created
October 17, 2018 01:45
-
-
Save Angelfire/e788586b7edaa0f67cd346df542725b7 to your computer and use it in GitHub Desktop.
Reverse string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
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