title: Await Not Working With Firebase Firestore Calls Javascript
body: <p>For some reason this works</p>
  <pre><code>const docRef = doc(db, &quot;users&quot;, &quot;1&quot;);
  const docSnap = await getDoc(docRef);
  const currentWeek = docSnap.get('currentWeek')
  const onLoadPage = docSnap.get('currentPage')
  </code></pre>
  <p>But this doesn't</p>
  <pre><code>function getCurrentPage() {
  const docRef = doc(db, &quot;users&quot;, &quot;1&quot;);
  const docSnap = await getDoc(docRef);
  const currentWeek = docSnap.get('currentWeek')
  };
  </code></pre>
  <p>It hangs up on the 'await' and the console says</p>
  <blockquote>
  <p>Unexpected reserved word (Points to await)</p>
  </blockquote>
  <p>Why does it work the first time but not the second?
  This happens all the time and I dont understand it</p>
  <p>It seems to me that this is happening because await is being used consecutively.
  Await seems to work when used localy within things but if its used twice in a open area it doesn't seem to like it</p>