random number generator 1 to 5 javascript code example Example: javascript random number between Math.floor(Math.random() * 6) + 1