js加减法

<html>
 <head>
  <meta http-equiv="content-type" content="text/html;charset="utf-8">
  <script>
  function getRandom(){//孤风傲雪逗自己玩
   var rnd=Math.random();
   var number=Math.floor(rnd * 10);
   return number;
   }
  var a = getRandom();
  var b = getRandom();
  var aaa=a;
  var bbb=b;
  var aa=String(a);
  var bb=String(b);
  if(getRandom()%2==0){
  var c = a + b;  
  var password=prompt(aa+"+"+bb+"="+"?","");
   if(password == c){
     
   alert("正确");
  }else{
   alert("错误");
   }
  }else{
   var c = a - b;  
  var password=prompt(aa+"-"+bb+"="+"?","");
   if(password == c){
     
   alert("正确");
  }else{
   alert("错误");
   }
    
    
    
    
  }
  </script>
   
   
   
 </head>
 <body>
   
 </body>
</html>