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 is the difference between script type and the script language attributes?
How to replace all occurrences of a string in JavaScript?
What is the role of javascript in html?
how to use java script
What are associative arrays in javascript?
what is the purpose of using jsp?
What do you mean by script?
Is javascript object a hash table?
Where can I learn javascript for beginners?
What is strict mode?
What are the different boolean operators in JavaScript?
What is a module in javascript?