Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Can you write a random integers function to print integers with in a range?



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

Post New Answer

More JavaScript Interview Questions

Explain equality operators in javascript?

0 Answers  


How to create a popup warning box?

0 Answers  


how can we retrieve value from one database server and store them another database server using sql server code

0 Answers   HP,


What are javascript closures?when would you use them?

0 Answers  


How about 3+5+"8"?

0 Answers  


What is the use of Void(0)?

0 Answers  


Is there automatic type conversion in JavaScript?

0 Answers  


How do I start a javascript project?

0 Answers  


Explain why asynchronous code is important in javascript?

0 Answers  


What are the main uses of javascript?

0 Answers  


Why is var better than let?

0 Answers  


write a program using javascript/ vbscript that checks if two matrices have identical values in all the elements.

1 Answers  


Categories