Logo white

王明 / Recruitment

Sign in
  • Sign in
  • Project
  • Files
  • Commits
  • Network
  • Graphs
  • Milestones
  • Issues 0
  • Merge Requests 0
  • Labels
  • Wiki
  • Recruitment
  • node_modules
  • uview-ui
  • libs
  • function
  • random.js
  • s
    25852764
    unknown authored
    2023-02-14 17:01:32 +0800  
    Browse Code »
random.js 196 Bytes
Edit Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10
function random(min, max) {
	if (min >= 0 && max > 0 && max >= min) {
		let gab = max - min + 1;
		return Math.floor(Math.random() * gab + min);
	} else {
		return 0;
	}
}

export default random;