JavaScript Tip: get a Random Number between two Integers

advertisement

In JavaScript, we can get a Random number; however, this number is between 0 and 1 which is not very useful when we want to work with integers. For example, executing the random method of the Math Object we can get something like this: