title: VM1290 app.html:2 Uncaught SyntaxError: Unexpected token }
body: <p>I am getting this error in my code...</p>
  
  <p>VM1290 app.html:2 Uncaught SyntaxError: Unexpected token }</p>
  
  <p>I have searched a ton, but I can't seem to find how to resolve the error. At first I thought it was an illegal invisible character, so I retyped all my code. Then I ran my code, but I still got the error! Please help. Here is my code</p>
  
  <pre><code>function battle(src) {
      document.getElementById("myModal").style.display = 'none';
      const random = Math.floor(Math.random() * 3);
      document.getElementById("attack-content").style.display = 'block';
      document.getElementById("creature_attacker").src = src;
      //The if statment choosing what the computer will choose for a creature
      if (random === 1) {
          document.getElementById("computer_attackercom").src = 'resources/creatures/pug.png';
      } else if (random === 2) {
          document.getElementById("computer_attackercom").src = 'resources/creatures/goat.png';
      } else if (random === 3) {
          document.getElementById("computer_attackercom").src = 'resources/creatures/brid.png';
      } else if (random === 4) {
          document.getElementById("computer_attackercom").src = 'resources/creatures/deer.png';
      } else {
          document.getElementById("computer_attackercom").src = 'resources/creatures/moose.png';
      }
      let attackedTrue = Math.floor(Math.random() * 10);
      setTimeout(function() {
          if (attackedTrue &gt;= 5) {
              alert("You Lost! -50 Cash! -5 Pods!");
              user_Cash_amount += 50;
              num0_pods205 += 5;
              document.getElementById("attack-content").style.display = 'none';
          } else {
              alert("You Win! +100 Cash! +5 Pods!");
              user_Cash_amount += 100;
              num0_pods205 += 5;
              document.getElementById("attack-content").style.display = 'none';
          }
      }, 2000);
  };
  </code></pre>