Test Set 5

Share it

Time limit: 15:00

Practice Test
1 2 3
Question 1 of 3
Refer to the code below:
const fs = require('fs');

fs.writeFile('example.txt', 'Hello World', (err) => {
  if (err) throw err;
  fs.readFile('example.txt', 'utf8', (err, data) => {
    if (err) throw err;
    console.log(data);
  });
});
What is the output of the above code if 'example.txt' does not already exist?
Choose 1 answer