I just wanted to read a file with node.js.
I used to use this notation:
fs.readFile('/etc/passwd', function(err, data) {
if (err) throw err;
console.log(data);
});
Node.js’s documentation provides the following code:
fs.readFile('/etc/passwd', (err, data) => {
if (err) throw err;
console.log(data);
});
What's the difference between them?