title: Array.length says it's 0 even when it's not React/Javascript/Typescript
body: <p>I'm trying to store persistent data for an an electron app with electron-json-storage, I tried using neDB but it would throw this error so I switched however it looks like it's not neDB's issue but my own.</p>
  <p>Here is the problem: I'm trying to get information out of the storage and when I call the respective get method and put the information out to the console everything seems fine inside the Getmethod, everything even seems fine when i do console.log(Get()) but as soon as I try to map it or get the length of the returned array it thinks that array is empty.</p>
  <p>Here is my code:</p>
  <pre><code>import * as React from &quot;react&quot;;
  import { Component } from &quot;react&quot;;
  import { ToastContainer } from &quot;react-toastify&quot;;
  import { connect } from &quot;react-redux&quot;;
  import GetAllCharacters from &quot;../../scripts/GetAllCharacters&quot;;
  const mapStateToProps = (state) =&gt; {
      return {
          character: state,
      };
  };
  
  const mapDispatchToProps = (dispatch) =&gt; ({});
  
  const Sheet = (props) =&gt; {
      const [characters, setCharacters] = React.useState();
      return (
          &lt;div className=&quot;container-fluid&quot;&gt;
              &lt;div className=&quot;row&quot; style={{ marginRight: &quot;0px&quot; }}&gt;
                  {props.character != null ? (
                      &lt;&gt;
                          //Code Removed for irrelevancy
                      &lt;/&gt;
                  ) : (
                      &lt;&gt;
                      {console.log(GetAllCharacters()}&lt;--prints an array of characters to the console
                      {GetAllCharacters().length}&lt;/&gt;&lt;--returns 0 despite the fact it just printed the characters to the console
                  )}
              &lt;/div&gt;
          &lt;/div&gt;
      );
  };
  
  export default connect(mapStateToProps, mapDispatchToProps)(Sheet);
  </code></pre>
  <p>GetAllCharacters()</p>
  <pre><code>import { Character } from &quot;../Data/Character&quot;;
  
  function GetAllCharacters() {
      var returnCharacters: Character[] = [];
      const storage = require(&quot;electron-json-storage&quot;);
  
      storage.getAll(function (error, data) {
          if (error) throw error;
          Object.entries(data).map((c) =&gt; {
              returnCharacters.push(&lt;Character&gt;c[1]);
          });
      });
      console.log(returnCharacters);
      return returnCharacters;
  }
  export default GetAllCharacters;
  </code></pre>