Are you sure you're getting this? Is this statement true or false?
Is the given function correct, and is this a valid method to read first n
characters of a file?
1const fs = require('fs');
2
3fs.readFile('filename.txt', (err, data) => {
4 if (err) throw err;
5 console.log(data.toString('utf8').substring(0,10));
6});
Press true if you believe the statement is correct, or false otherwise.