Q:

Write a JavaScript program to get a random number in the specified range

0

Write a JavaScript program to get a random number in the specified range.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

const random_Number_In_Range = (min, max) => Math.random() * (max - min) + min;
console.log(random_Number_In_Range(2, 10)); 
console.log(random_Number_In_Range(1, 5)); 
console.log(random_Number_In_Range(-5, -2)); 
console.log(random_Number_In_Range(0, 1)); 

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now