Get Random numer between two numbers - Javascript

Random number A-B

Snippet Code


  
Rate this page :
  [ 0 votes]

If you want to get random number between a to b by calling this function you can get the value

function getrand(from,to) { var number = (Math.random()*parseInt(to-from)).toFixed(0); return number from; }

Tags


Ask Questions

Ask Question