Created
February 18, 2015 01:53
-
-
Save plusjade/0a0c8d1b0b0cfaa03893 to your computer and use it in GitHub Desktop.
randomize an array
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> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.7.0/underscore-min.js"></script> | |
</head> | |
<body> | |
<script> | |
var numbers = [1,2,3,4,5,6,7,8,9]; | |
var randomNumbers = _.shuffle(numbers, numbers.length); | |
console.log(numbers); | |
console.log(randomNumbers) | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment