Put this code into the correct order. We need to read the data from two files and find the sum.
Fs promises
Find sum
Report a typo
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());
} ___
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.