How to generate Two Random Number in javascript such as the 1st number is always greater than the second and also in another code please share how to generate two random number such as the first number is always divisible by the second?(如何在javascript中生成两个随机数,例如第一个数字总是大于第二个,并且在另一个代码中,请分享如何生成两个随机数,例如第一个数字总是被第二个整除?)
I am trying(我在尝试)
var x = (Math.floor(Math.random() * 100) + 1); var y = ((Math.floor(Math.random() * 100) + 1) <= x); console.log(x, y);
but I am only getting the value of x and instead geting the value of y I am getting true or false.(但是我只得到x的值,而不是得到y的值,我得到的是对还是错。)
ask by Tamanna Hasan Mouli translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…