Skip to main content
Journey Uncommon Logo
JourneyUncommon
easyNodeJScallbacks error-firstSingle-choice MCQ

Why does this `try/catch` fail to catch the error thrown inside the callback?

const fs = require('fs'); try { fs.readFile('missing.txt', 'utf8', (err, data) => { if (err) throw err; console.log(data); }); } catch (e) { console.log('caught:', e.message); }