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 applications use javascript?
If you need to hide the javascript code from the older browser versions, how will you perform it?
Explain what is pop()method in JavaScript?
What is external javascript?
Mention what is the disadvantage of using innerhtml in javascript?
If an array with name as "names" contain three elements, then how will you print the third element of this array?
Write a JavaScript function which can take any number of strings as arguments and outputs them as a single concatenated string.
How you will write a java script function that display an alert on the screen?
Is there any ide for javascript?
What is console.log() and why it is used?
How to write comment in JavaScript?
What is Javascript namespacing? How and where is it used?