title: Accessing a dictionary in a separate JS file and retrieve value
body: <p>I would like to keep all of error descriptions in a single .js file as a dictionary, so that I can display the appropriate description from the rest of my JavaScript web app. I am very new to JS web app development and I am wondering how to achieve this.</p>
  
  <p>currently I have been trying this:</p>
  
  <p><strong>errorDesc.js:</strong></p>
  
  <pre><code>var descriptions = {
      errorCode00 : "description",
      errorCode02 : "description",
      errorCode03 : "description"
  }
  
  export function getResponseDescription(name) {
      return descriptions[name];
  }
  </code></pre>
  
  <p><strong>main.js:</strong></p>
  
  <pre><code>import {getResponseDescription} from "./errorDesc";
  </code></pre>
  
  <p>But in the console I get the following error:
  Uncaught SyntaxError: Unexpected token {</p>
  
  <p><a href="https://i.stack.imgur.com/hbfu8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hbfu8.png" alt="enter image description here"></a></p>