var n = parseInt(Math.random()*10);
while (isNaN(n)) {
  n = parseInt( Math.random() * 10)
} 