title: How to use async/await syntax with forEach loop in Javascript?
body: <p>I've looked at several questions on using async/await with a forEach loop but nothing seems to cover my user case... How can I get the code below to work? Right now I'm getting the following error: </p>
  
  <blockquote>
    <p>await is a reserved word</p>
  </blockquote>
  
  <p>Here's the code: </p>
  
  <pre><code>export const fetchUserBookmarks = ( bookmarksIDs ) =&gt; async ( dispatch, getState, api ) =&gt; {
  
      dispatch({
          type: 'IS_FETCHING_BOOKMARKS'
      });
  
      try {
  
          bookmarks = [];
  
          bookmarksIDs.forEach( bookmarkID =&gt; {
              const bookmark = await api.get( selectedPostByIdEP + bookmarkID ); 
              bookmarks.push( bookmark ); 
          }); 
  
          dispatch({
              type: 'HAS_FETCHED_BOOKMARKS', 
              payload: bookmarks
          });
  
      } catch( error ) {
  
          dispatch({
              type: 'FAILED_FETCHING_BOOKMARKS', 
              payload: error
          });
  
      }
  
  }
  </code></pre>