randomInt()

🔰 JSFunctionsGlobal

// ⭐️ syntax:
//    randomInt(min, max)
// ⭐️ examples:
//    randomInt(0, 255)    // choose from 0 ... 255 (included)
export function randomInt(min, max) {
  return Math.floor(Math.random()*(max-min+1)) + min;
}

Last updated