Skip to content

Instantly share code, notes, and snippets.

@Kiwipup
Created September 5, 2018 22:01
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 Kiwipup/4727f0c75899568a8b219b3c1e7b6a4b to your computer and use it in GitHub Desktop.
Save Kiwipup/4727f0c75899568a8b219b3c1e7b6a4b to your computer and use it in GitHub Desktop.
coderbyte reversing string
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());
@MatthewGidcomb
Copy link

This looks good.
One small note on terminology: split and reverse are better described as functions or methods than objects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment