Sorting code fragments

Report a typo

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.

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 = [];
___

Create a free account to access the full topic