Math.floor(Math.random() * (max - min + 1)) + min
To fork the fiddle and follow along: https://jsfiddle.net/easyjs/hnvm0fg1/
Also check out my C++ random number generator which has helped thousands of people: https://youtu.be/Wh-dFCpVQyY
Get the code here: C++ Random Number Generator Tutorial
Remember to checkout the Resources section below for associated downloadable content, JSFiddle links, and other resources. Watch the video and follow along!