Jump to content

var isn't being defined


bloodbarron115
 Share

Recommended Posts

I need these 2 variables:

 

newEquation: function () {

         var x = Math.floor(Math.random() * (10 - 1)) + 1;
         var y = Math.floor(Math.random() * (10 - 1)) + 1;
}
 
to be defined in this if statement:
 
update: function () {
 
         if (myInput == x + y) {
                  this.correct();
         }
         else {
                  this.wrong()
         }
},

 

While staying in the newEquation funciton

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...