Find sum

Report a typo

Put this code into the correct order. We need to read the data from two files and find the sum.

Put the items in the correct order
catch (err) {
console.log(err);
}
const { readFile, writeFile } = require('node:fs/promises');
};
const findSum = async () => {
const sum = Number(data1) + Number(data2);
try {
const data1 = await readFile('num1.txt', 'utf-8');
const data2 = await readFile('num2.txt', 'utf-8');
await writeFile('sum.txt', sum.toString());
}
___

Create a free account to access the full topic