We have three files, and each of them has a person's name. We need to read all the names and put them into an array. Put the fragments below into the correct order to achieve this goal.
Fs promises
Sorting code fragments
Report a typo
Put the items in the correct order
for (let file of files) {
readFile(file, "utf-8").catch(err => console.log(err))
};.then(data => names.push(data))const files = ["user1.txt", "user2.txt", "user3.txt" ];
const names = []; ___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.