Advanced JavaScript
Q70 / 100

What is the difference between ESM and CJS module systems?

Correct! Well done.

Incorrect.

The correct answer is B) ESM (import/export) is statically analyzed, supports live bindings, and is async; CJS (require) is synchronous, dynamic, and copies values

B

Correct Answer

ESM (import/export) is statically analyzed, supports live bindings, and is async; CJS (require) is synchronous, dynamic, and copies values

Explanation

ESM is the standard. CJS is Node.js legacy. ESM enables tree shaking. ESM bindings are live (updating with the exported value). CJS require() is synchronous blocking.

Progress
70/100