random interger generator

 let step1 = Math.random()

console.log(step1)

let step2 = step1 * 10

console.log(step2)


let step3 = Math.floor(step2)

console.log(step3)


let step4 = step3 + 1

console.log(step4)


=======================================



Easy way

Math.floor(Math.random()*100) + 1


Comments

Popular posts from this blog

practice test of Arithmetic Operations: