title: How can I import functions from an other javascript file?
body: <p>I'm pretty new in JS, and I have some trouble with importing.</p>
  
  <p>I'm doing a Star Wars planet list application, where I'd like to import functions from an other JS file like this:</p>
  
  <p>--- dataManager.js ---</p>
  
  <pre><code>export function getAllPlanetDataFromAPI() {
  
      let allPlanetsInfo = new XMLHttpRequest();
      allPlanetsInfo.open('GET', 'https://swapi.co/api/planets');
      allPlanetsInfo.onload = function () {
          console.log(allPlanetsInfo.responseText)
      };
      allPlanetsInfo.send();
  
  }
  </code></pre>
  
  <p>--- main.js ---</p>
  
  <pre><code>import { getAllPlanetDataFromAPI } from './dataManager';
  
  getAllPlanetDataFromAPI();
  </code></pre>
  
  <p>The error message I get is: "Uncaught SyntaxError: Unexpected token {"</p>
  
  <p>Seems like the syntax is incorrect, but I have already checked all of the "import" articles on the web, and couldn't find what I'm doing wrong.</p>