title: How to Parse multiple JSON files to a Same Javascript object?
body: <p>There is a folder with multiple JSON files that are in the same JSON format. Each file contains the following information: first name, last name, birthday, address, and phone number. Your task is to read all files and parse the data into the same person object. The task is to list all data in any output format you choose, which can be a console as well.</p>
  <p>This is my code in NodeJs</p>
  <pre><code>import {readdir, readFile} from &quot;fs&quot;;
  const dir = &quot;./src/json&quot;;
  const dirAccess = readdir(`${dir}`, (err, files) =&gt; {
    files.forEach((file) =&gt; {
      const read = readFile(`${dir}/${file}`, &quot;utf8&quot;, (err, data) =&gt; {
        let p = JSON.parse(data);
        console.log(p);
      });
    });
  });
  </code></pre>
  <p>I have my data on 'p', now my question is How can I put all the Parsed
  JSON data to the Same Person Object?</p>
  <p><a href="https://i.stack.imgur.com/pL8IE.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pL8IE.jpg" alt="enter image description here" /></a></p>
  <p><a href="https://i.stack.imgur.com/kk0At.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kk0At.jpg" alt="enter image description here" /></a></p>