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

A function calls its callback both synchronously and asynchronously depending on input. Why is this considered a bad pattern?

function get(key, cb) { if (cache[key]) return cb(null, cache[key]); // sync fetchRemote(key, cb); // async }