Can you write a random integers function to print integers with in a range?
Answer / hrpatelsoft@gmail.com
function randomInteger(min, max) {
return Math.floor(Math.random() * (max - min + 1) ) + min;
}
randomInteger(1, 100); // returns a random integer from 1 to 100
randomInteger(1, 1000); // returns a random integer from 1 to 1000
Is This Answer Correct ? | 0 Yes | 0 No |
What are the three core languages in web pages?
Which is better python or javascript?
Is there any class in javascript?
What is === in javascript?
How to write a function in javascript?
How do I open javascript on my iphone?
What is the difference between the operators '==' and '==='?
What are the methods of validating whether the form is secure?
What are the predefined functions in javascript?
How we can get the value of an element using javascript?
Name the datatypes of javascript?
What do mean by NULL in Javascript?