title: Trying to find missing declarations / statements in JS
body: <p>Driving myself totally crazy trying to see how I messed up the declarations in this little chunk of code I am working on. Been tinkering for an hour and cant figure it out.</p>
  
  <pre><code>
  window.addEventListener("load", function load(event) {
      firebase.auth().onAuthStateChanged(function (user) {
          if (user) {
              firebase.auth().currentUser.getIdTokenResult()
                  .then((idTokenResult) =&gt; {
                      console.log(idTokenResult)
                      // Confirm the user is paid
                      if (!!idTokenResult.claims.member) {
                          // Show paid UI
                          console.log("Membership Already Started")
                      } else {
                          // Show regular user UI.
                          let user = firebase.auth().currentUser;
                    const subCollRef = db.collection("stripe_customers").doc(user.uid).collection("charges");
                    const query = subCollRef.orderBy('created', 'desc').limit(1);
                          var d = new Date();
                          var year = d.getFullYear();
                          var month = d.getMonth();
                          var day = d.getDate();
                          var c = new Date(year + 1, month, day);
                          console.log(c);
                          query.get()
                          .then(snapshot =&gt; {
                            if (snapshot.size &gt; 0 &amp;&amp; snapshot.docs[0].data().status === "succeeded") {
                              var xhttp = new XMLHttpRequest();
  
                              console.log(user.uid)
                              xhttp.open(
                                  "POST",
                                  "https://us-central1-*****y.cloudfunctions.net/addMemberRole",
                                  true
                              );
                              xhttp.setRequestHeader("Content-Type", "application/json");
                              xhttp.send(
                                  JSON.stringify({
                                      uID: user.uid
                                  }),
                                  console.log(xhttp.responseText)
                              );
                              console.log("should still be working HOPEFULLY HERE YOU ARE")
                              user.getIdToken(true)
                              setMembershipDate({
                                  mDateS: d.getTime(),
                                  mDateE: c.getTime()
  
  
  
                          })
                          .catch(err =&gt; {
                            console.log('Error getting documents', err);
                          })
                          })
                      }
  
                  })
              }
  
          })
      })
  
  
  
  </code></pre>
  
  <p>The error states Declaration or statement expected. line 74 here is a snippet of line 74 from the code above</p>
  
  <pre><code>})
                          .catch(err =&gt; {
                            console.log('Error getting documents', err);
                          })
                          }) &lt;---- line 74 
  
  </code></pre>