Created
March 16, 2017 21:25
-
-
Save aetweedie/1dc778fd2707254fed57aad5e2258636 to your computer and use it in GitHub Desktop.
JS Bin Reverse a string // source http://jsbin.com/veyulo
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="Reverse a string"> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
var str = 'ryan'; | |
var reverser = function (str) { | |
return str.split('').reverse().join(''); | |
}; | |
console.log(reverser(str)); | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">var str = 'ryan'; | |
var reverser = function (str) { | |
return str.split('').reverse().join(''); | |
}; | |
console.log(reverser(str)); | |
</script></body> | |
</html> |
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
var str = 'ryan'; | |
var reverser = function (str) { | |
return str.split('').reverse().join(''); | |
}; | |
console.log(reverser(str)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment