function randomIntFromInterval(min, max) { // min and max included return Math.floor(Math.random() * (max - min + 1) + min); }
Math.floor(Math.random() * 3);
function randomInRange(min, max) { return Math.floor(Math.random() * (max - min + 1) + min); }