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 |
Is javascript insecure?
What does parse Query String return in javascript?
Is a hash table an array?
What does "1"+2+4 evaluate to?
How do I turn off javascript in chrome?
Explain a story about javascript performance problems?
List some design patterns in javascript?
Why is javascript so popular?
How to call a function in every x seconds in javascript?
How much do javascript programmers make?
What is the main difference between Client side JavaScript and and Server side Java Script?
Write a JavaScript function which can take any number of strings as arguments and outputs them as a single concatenated string.