Solution to Sub-task: Read Files
Explore how to create an asynchronous function in JavaScript that reads all text files within a directory. Understand using promises, filtering file paths, and leveraging Promise.all to handle multiple asynchronous file reads concurrently, returning their contents in a single array.
We'll cover the following...
We'll cover the following...
Read files
Here, use the directories from earlier as a reference point. Read all files so the path and data of each file is in a single array.
In this solution, first make the readFiles function asynchronous by adding the async token to the function (line 9). Then, get all path names in the directory dir utilizing our ...