JavaScript如何获取两个整数之间的随机整数?

const random = (min, max) => Math.floor(Math.random() * (max - min + 1) + min);
console.log( random(1, 50) );