Created
September 5, 2018 22:01
-
-
Save Kiwipup/4727f0c75899568a8b219b3c1e7b6a4b to your computer and use it in GitHub Desktop.
coderbyte reversing 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
function FirstReverse(str) { | |
// code goes here | |
str = "change string content here"; | |
//array is defining str.split as array, the .split object is splitting str into individual letters | |
array = str.split(""); | |
//.reverse object is taking the array that we just made and reversing its order | |
array.reverse(); | |
//array.join('') combines the string with the array without commas | |
str = array.join(''); | |
return str; | |
} | |
var array; | |
// keep this function call here | |
FirstReverse(readline()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This looks good.
One small note on terminology:
split
andreverse
are better described as functions or methods than objects.