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