C.W.K.
Stream
Quiz · 3 questions

🧩 Modules — Code Organization

ESM, import type, .d.ts, ambient modules, namespaces (legacy)

Level 0Curious
0 XP0/93 lessons0/23 achievements
0/100 XP to next level100 XP to go0% complete

Quiz

01What's the difference between import type and a regular import?
Hint
Look at the JavaScript output of a file that imports a type. With import type, the import line is missing entirely.
02What goes in a .d.ts file?
Hint
Open node_modules/typescript/lib/lib.es5.d.ts — every type in the standard library lives here as a declaration.
03Why did ES modules win over namespace?
Hint
Try to tree-shake a namespace — you can't. The whole namespace ships as one object. ESM imports can be analyzed and pruned individually.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.