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 |
Explain “use strict” ?
What’s a way to append a value to an array?
Why typeof null is object?
What will happen if an infinite while loop is run in Javascript?
What is the method for reading and writing a file in javascript?
Why is javascript good for websites?
What does the following statement declares?
What are limitations in javascript?
What are the data types available in javascript? Explain
How do you add an element at the end of an array?
About document.getElementID? Explain giving one example. This was asked by a interviewer when i said that i know some JavaScript.
Explain javascript debounce function?