Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardTypeScriptESM CJS interopSingle-choice MCQ

A `.ts` file imports a CommonJS module that uses `export =`. Without `esModuleInterop`, a default import errors; with it, the same default import compiles. What does `esModuleInterop` actually change for this case?

// cjs.ts: // export = function greet() { return "hi"; }; import greet from "./cjs"; greet();