Ad
Mathematics
Algorithms
Logic
Numbers
Fundamentals
Code
Diff
  • function Cube(){
      return Math.floor(Math.random()*6)+1;
      }
    • function Cube(){
    • let random = Math.floor(Math.random()*6+1);
    • if(random===1)return 1
    • else if(random===2)return 2
    • else if(random===3)return 3
    • else if(random===4)return 4
    • else if(random===5)return 5
    • else if(random===6)return 6
    • }
    • return Math.floor(Math.random()*6)+1;
    • }