nextRound
TechnologiesCoding ProblemsBookmarksLearning Paths
nextRound
TechnologiesCoding ProblemsBookmarksLearning Paths
nextRound

AI-powered interview preparation platform. Practice with curated questions, mock interviews, and personalized learning paths to crack your dream tech interview.

Quick Links

  • Technologies
  • Saved Questions
  • Pricing

Company

  • About Us
  • Contact Us

Legal

  • Privacy Policy
  • Terms of Use

© 2026 nextRound. All rights reserved.

TOPIC OVERVIEW

javascript/Modules

How JavaScript code gets split, shared, and loaded across files.

10 QuestionsIntermediateHigh Priority ~12 min read

Before ES modules, JavaScript had no built-in way to split code across files with real isolation — CommonJS (Node's require/module.exports) and AMD filled that gap with different tradeoffs, both resolving and loading modules dynamically at runtime. ES modules (import/export) standardized this at the language level, and critically, they're statically analyzable: imports and exports must be declared at the top level, which lets tools determine the entire dependency graph without running any code.

That static structure is what makes tree-shaking possible — a bundler can see exactly which exports are actually used and strip out the rest, something CommonJS's dynamic require() calls make much harder to do reliably. ES modules also behave differently in subtle ways: they're automatically in strict mode, they're loaded once and cached (re-importing returns the same module instance), and top-level await lets a module pause on an async operation before anything that imports it can proceed.

What you'll walk away knowing

The structural difference between ES modules and CommonJS — static vs. dynamic resolution
Why static imports/exports enable tree-shaking and CommonJS largely doesn't
How dynamic import() differs from static import, and when you'd reach for it
What top-level await does to module loading order, and where it can cause deadlocks

No questions match "".

All Topics
1
Basics
Data Types
Functions
Objects
2
Engine
JIT
V8
Event Loop and Runtime
Concurrency and Threading
Bytecode and Parsing
Execution Context
Garbage Collector
3
this
Call Apply Bind
Closure
Error Handling
4
String Operations
Array Operations
Iterator and Generator
Modules
5
Events
Promises
Web Workers
Web Sockets
6
Functional Programming
Currying
Higher Order Functions
Memoisation
7
ES6 Classes
ES6
PWA
Web Assembly
Browser APIS
8
Security
Code
Polyfills
Sharethis topic

Share via WhatsApp, X, Facebook, LinkedIn or copy link. Open Graph preview enabled.