• This project
    • Loading...
  • Sign in

陈嘉濠 / lucky-uniapp · Files

Go to a project

GitLab

  • Go to dashboard
  • Project
  • Activity
  • Files
  • Commits
  • Pipelines 0
  • Builds 0
  • Graphs
  • Milestones
  • Issues 0
  • Merge Requests 0
  • Members
  • Labels
  • Wiki
  • Forks
  • Network
  • Create a new issue
  • lucky-uniapp
  • 0815luckyStart
  • libs
  • function
  • random.js
  • 更新回收和兑换商品
    175d529c
    by 陈嘉濠
    2022-08-17 16:47:35 +0800  
    Browse Files
random.js 196 Bytes
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;