function gimmeRandom() { return Math.floor(Math.random()*10)+1; } function countToRandom(_count) { for (i = 1; i <= _count; i++) { console.log(i); } } var rand; console.log("...."); countToRandom(gimmeRandom()); console.log("...."); countToRandom(gimmeRandom());