title: JavaScript function importing doesn't work properly
body: <p>I'm referring the code below.
  <a href="https://github.com/jonasschmedtmann/complete-javascript-course/blob/master/9-forkify/final/src/js/views/searchView.js" rel="nofollow noreferrer">https://github.com/jonasschmedtmann/complete-javascript-course/blob/master/9-forkify/final/src/js/views/searchView.js</a></p>
  
  <p>I made a function and tried to import the function to another js file but it doesn't work. If I write "elements.searchInput.value;" it won't work while if I do "console.log(elements.searchInput.value)" it will work. I'm doing exactly the same as the reference file but just wondering why my code doesn't work.</p>
  
  <pre><code>index.js
  
  import "./../styles/style.scss";
  import Search from './models/Search';
  import * as searchView from './views/SearchView';
  import { key, proxy } from './config';
  import { elements } from './views/Base';
  
  const state = {};
  
  const controlSearch = async () =&gt; {
      const query = searchView.getInput(); // &lt;- This doesn't work
      console.log(query) // Get nothing
  
      if(query) { // &lt;- Can't get in to this part
          state.search = new Search(query);
          console.log("New Search", state);
      }
  }
  
  elements.searchForm.addEventListener('submit', e =&gt; {
      event.preventDefault();
      controlSearch();
  });
  
  </code></pre>
  
  <pre><code>searchView.js
  
  import { elements } from './base';
  
  export const getInput = () =&gt; {
      elements.searchInput.value; // This code won't show up in controlSearch function
  
  export const clearInput = () =&gt; {
      elements.searchInput.value = '';
  };
  </code></pre>
  
  <pre><code>base.js
  
  export const elements = {
      searchForm: document.querySelector('.search'),
      searchResult: document.querySelector('.movie_list'),
      searchInput: document.querySelector('.search__field')
  }
  </code></pre>
  
  <pre><code>Search.js
  
  import { key } from '../config';
  
  export default class Search {
      constructor(query) {
          this.query = query;
      }
  
      async getResults() {
          try {
              const res = await axios(`http://`);
              this.result = res.data.results;
          }
  
          catch (error) {
              alert(error);
          }
      }
  
  }
  </code></pre>