var code = myFunction(30,100); function myFunction(begin,end){ var num = Math.round(Math.random()*(end-begin)+begin); return num; }