title: "Invalid left-hand side in assignment" when trying to add a cookie to a variable?
body: <p>I keep getting an error on line 31 of this <a href="https://znepb.me/games/money-clicker/game/game.js" rel="nofollow noreferrer">script</a>: </p>
  
  <pre><code>var cAdd = 1;
  
  function getCookie(cname) {
      var name = cname + "=";
      var decodedCookie = decodeURIComponent(document.cookie);
      var ca = decodedCookie.split(';');
      for(var i = 0; i &lt;ca.length; i++) {
          var c = ca[i];
          while (c.charAt(0) == ' ') {
              c = c.substring(1);
          }
          if (c.indexOf(name) == 0) {
              return c.substring(name.length, c.length);
          }
      }
      return "";
  }
  
  var myCookie = getCookie("money");
  
  if (myCookie == null) {
      document.cookie = "money="+money;
  }
  
  
  console.log(Number(getCookie("money")))
  document.getElementById("m").innerHTML = "$"+getCookie("money");
  
  var giveMoney = (function() {
      return function() {
          console.log(Number(getCookie("money"))
          console.log(Number(getCookie("money")) += cAdd)
          var addMoney = Number(getCookie("money")) += cAdd;
          document.cookie = "money=" + addMoney;
          document.getElementById("m").innerHTML = "$"+getCookie("money");
  
          return getCookie("money");
      }
  }(0)); // -1 if you want the first increment to return 0
  
  var removeCookieNotice = (function() {
      return function() {
          var elem = document.getElementById('CookieNotice');
          elem.parentNode.removeChild(elem);
          return false;
      }
  }());
  </code></pre>
  
  <p>I've tried googling the error, but to no peril.</p>
  
  <p>Any help would be awesome, thanks!</p>