Confusion around the callback in arrow function in
readFile(filePath, (error, file) => {
// code here
})
Add to mentor walkthrough notes:
- Clarify that
readFile takes 2 arguments. The second argument is a callback function. We are defining that function & using the error-first pattern.
- Re-write this line using ES5 syntax i.e.
readFile(filePath, function(error, file) {}), which students are more familiar with. Comment out the ES5 version and leave it directly above the ES6 version for comparison.