Created
March 30, 2015 10:15
-
-
Save wcoder/47e0f66ddd950cdf5852 to your computer and use it in GitHub Desktop.
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 = "Hello World!"; | |
function rev1(s){return s.split('').reduce(function(a,b){return b+a;}).join('');} | |
function rev2(s){return s.split('').reverse().join('');} | |
console.log(rev1(str)); | |
console.log(rev2(str)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment