We are calling here the same function with the different parameters. We can use this guessing game or the OTP related kinds of stuff. Math.floor(Math.random() * 100) Math.random always returns a decimal number, so we need to rounding off that number first. JavaScript Random Integers. This is a guide to Random Number Generator in JavaScript. It will generate first and last names, and we'll have the option to specify gender too.