Skip to content

Instantly share code, notes, and snippets.

@omermindivanli
Last active September 10, 2018 14:11
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 omermindivanli/f903d4a67736916d135f47dc2541e262 to your computer and use it in GitHub Desktop.
Save omermindivanli/f903d4a67736916d135f47dc2541e262 to your computer and use it in GitHub Desktop.
Reverse a string and then see the output...
function reverser(word){
return word
.split("") // split an string into arr
.reverse() // reverse and arr completely
.join("") // turn and arr of elements to the string
}
// Call Function
const output = reverser("mindivanli");
console.log(output); // ilnavidnim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment