Put the code snippets into the correct order. The code should read from one source and write it to another one. As a result, you should see the joke-copy.txt file created, which is a copy of joke.txt.
Write stream
Fix order
Report a typo
Put the items in the correct order
const fs = require('node:fs');readableStream.on('data', function(chunk) {
writableStream.write(chunk);
});const readableStream = fs.createReadStream('joke.txt');
const writableStream = fs.createWriteStream('joke-copy.txt');readableStream.setEncoding('utf8');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.