Last active
September 10, 2018 14:11
-
-
Save omermindivanli/f903d4a67736916d135f47dc2541e262 to your computer and use it in GitHub Desktop.
Reverse a string and then see the output...
This file contains hidden or 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 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