Created
February 17, 2015 17:20
-
-
Save aweary/9c8052d390924bdeb2ee to your computer and use it in GitHub Desktop.
Random character formation from an input string
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
var scrambleWord = function(word){ | |
var result = ""; | |
var i = word.length; | |
while(i--){ | |
result += word.charAt(Math.floor(Math.random() * word.length)); | |
} | |
return result | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment