title: Discord.js getting data from a JSON file returns "undefined"
body: <p>I'm trying to access data from an <code>orders.json</code> file. It should list all <code>orders</code>, however, it says &quot;undefined&quot; when I try to do that as shown in the pic below:</p>
  <p><a href="https://i.stack.imgur.com/5dYfN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5dYfN.png" alt="enter image description here" /></a></p>
  <p>It also does the same thing when there aren't any <code>orders</code> in the JSON file:</p>
  <p><a href="https://i.stack.imgur.com/IW2fr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IW2fr.png" alt="enter image description here" /></a></p>
  <p><code>.list</code> command's code:</p>
  <pre class="lang-js prettyprint-override"><code>const fsn = require(&quot;fs-nextra&quot;);
  const Discord = require('discord.js');
  module.exports = {
      name: 'list',
      description: 'List of all orders',
      aliases: ['allorders'],
      execute(message) {
          
  
          fsn.readJSON(&quot;./orders.json&quot;).then((orderDB) =&gt; {
              let orderString;
              for(let x in orderDB) {
                  orderString = orderString + &quot;`&quot; + x + &quot;`: &quot; + orderDB[x].status + &quot;\n&quot;;
                  // add newline character at the end to display each &quot;order&quot; on a separate line
              }
              const exampleEmbed = new Discord.MessageEmbed()
                  .setTitle('Here\'s a list of the current orders and their status.')
                  .setDescription(orderString)
                  .setTimestamp()
                  .setFooter(message.member.user.tag, message.author.avatarURL());
              message.channel.send(exampleEmbed);
          });
      }
  }
  </code></pre>
  <p>data in the json file are stored like this:</p>
  <pre class="lang-js prettyprint-override"><code>{
      &quot;tip&quot;: {
          &quot;orderID&quot;: &quot;tip&quot;,
          &quot;userID&quot;: &quot;734532125021307001&quot;,
          &quot;guildID&quot;: &quot;745409671430668389&quot;,
          &quot;guild&quot;: &quot;Cybers Taco Stand Server&quot;,
          &quot;channelID&quot;: &quot;746423099871985755&quot;,
          &quot;order&quot;: &quot;a&quot;,
          &quot;customer&quot;: &quot;Aro#1221&quot;,
          &quot;status&quot;: &quot;Unclaimed&quot;,
          &quot;ticketChannelMessageID&quot;: &quot;not set&quot;
      },
  }
  </code></pre>