Created
September 13, 2014 20:11
-
-
Save lelinhtinh/73121224562e16bb926b to your computer and use it in GitHub Desktop.
Lấy một đối tượng ngẫu nhiên trong mảng
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
// http://stackoverflow.com/a/4550514 | |
var rand = myArray[Math.floor(Math.random() * myArray.length)]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment