1 function getRandomIntNumber(min, max) { 2 var span = max - min + 1; 3 var result = Math.floor(Math.random() * span + min); 4 return result; 5 }
时间: 2024-10-17 07:22:14
1 function getRandomIntNumber(min, max) { 2 var span = max - min + 1; 3 var result = Math.floor(Math.random() * span + min); 4 return result; 5 }