HuyPV
Wednesday, April 11, 2012
randVal = function(a) {
return a[Math.floor(a.length * Math.random())];
}
alert(randVal(['huypv', 'huyphungvan', 'giacmoxanh_pvh', '=))']));
Title:
javascript - get random element in array
Description:
randVal = function(a) { return a[Math.floor(a.length * Math.random())]; } alert(randVal(['huypv', 'huyphungvan', 'gi...
...
Rating:
4