title: How to export a function and an array
body: <p>I have an array of nationalities in and a function that returns the name of nationality from the CountryCode. Both of them are in a file called <code>nationality.js</code>.</p>
  
  <p>Here is the function </p>
  
  <pre><code>map_code_to_nationality = (code) =&gt; {
      return nationalities.filter((data) =&gt; {
          return data.CountryCode == code
      })[0].Nationality
  }
  </code></pre>
  
  <p>Now I want to export the function and the list of nationality (i.e. an array of nationalities). I tried to export both of them like this.</p>
  
  <pre><code>export const map_code_to_nationality
  export const nationalities
  </code></pre>
  
  <p>Now if I use function keyword for map_code_to_nationality in the export statement the editor shows a syntax error and the export statements stated above gives an error in the  browser that </p>
  
  <blockquote>
    <p>Attempted import error: 'map_code_to_nationality' is not exported from
    '../../static_data/nationality_list'.</p>
  </blockquote>
  
  <p>I have imported it in other file like this</p>
  
  <pre><code>import { map_code_to_nationality, nationalities } from '../../static_data/nationality_list'
  </code></pre>
  
  <p>How do I use both the function and array by exporting them?</p>