random num generate function in JavaScript or jQuery
This is a good function for generate rand number in JavaScript or jQuery environment.
function getRandom(n){
return Math.floor(Math.random()*n+1);
}
getRandom(10); //6
getRandom(10); //5
This is a good function for generate rand number in JavaScript or jQuery environment.
function getRandom(n){
return Math.floor(Math.random()*n+1);
}
getRandom(10); //6
getRandom(10); //5
YiiLib Foucs on: Pro Web Dev Tutorial and Pro Web Dev Service
Copyright © 2011 - 2024 YiiLib.com(YiiBlog.info) - Designed & Developed by Boy.Lee
Leave Comment