leafiy
5/18/2018 - 6:53 PM

随机整数 random int #js #number

none

const randomIntegerInRange = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min;
// randomIntegerInRange(0, 5) -> 2