Function returning NaN when I try to generate basic math operations
<p>I am trying to generate randomly basic math operations(addition, subtractions, multiplication and  division) and sometime my function returns NaN.
    I used function parseInt(), but I still have the same problem. I will appreciate if anybody can help me with any suggestion.
    Thank you in advance!</p>

<pre><code>Here is my code:

function randNum(min,max)
{
    var num = min+Math.floor((Math.random()*(max-min+1)));
    return num;
}

var choose, operator, firstNum, secondNum,rightAnswer;
function getProb()
{
    var chooseOp=randNum(1,4);
    choose=parseInt(chooseOp);

if (choose==1)
{
    oprator="+";
    var choose1=randNum(0,10);
    var choose2=randNum(0,10);
    firstNum=parseInt(choose1);
    secondNum=parseInt(choose2);
    document.getElementById("mathProb").innerHTML=firstNum+operator+secondNum+"=";
    rightAnswer=choose1 + choose2;
}
else if (choose==2)
{
    operator="-";
    var choose1=randNum(0,10);
    var choose2=randNum(0,10);
    firstNum=parseInt(choose1);
    secondNum=parseInt(choose2);
    document.getElementById("mathProb").innerHTML=firstNum+operator+secondNum+"=";
    rightAnswer=firstNum - secondNum;
}
else if (choose==3)
{
    operator="x";
    var choose1=randNum(0,10);
    var choose2=randNum(0,10);
    firstNum=parseInt(choose1);
    secondNum=parseInt(choose2);
    document.getElementById("mathProb").innerHTML=firstNum+operator+secondNum+"=";
    rightAnswer=choose1 * choose2;
}
    else if (choose==4)
{
    operator="/";
    var choose1=randNum(0,10);
    var choose2=randNum(0,10);
    firstNum=parseInt(choose1);
    secondNum=parseInt(choose2);
    document.getElementById("mathProb").innerHTML=firstNum+operator+secondNum+"=";
    rightAnswer=choose1/choose2;
}
}
</code></pre>
