Created
January 7, 2012 11:56
-
-
Save aglemann/1574561 to your computer and use it in GitHub Desktop.
This file contains 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 rossify(sentence){ | |
var re = /\w+/g, words = sentence.match(re); | |
return sentence.replace(re, function(){ | |
return words.pop(); | |
}); | |
} | |
// > rossify('hi, my name is aeron. today i am good!'); | |
// "good, am i today aeron. is name my hi!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment