Modern JavaScript (ES6+) for Beginners
Lesson 12 of 12 100% of course

Modules — import/export & What to Learn Next

0 · 5 min · 6/7/2026

Learn Modules — import/export & What to Learn Next in our free Modern JavaScript (ES6+) for Beginners series. Step-by-step explanations, examples, and interview tips on Toolliyo Academy.

Sign in to track progress and bookmarks.

Modules — import/export & What to Learn Next
Lesson 12 of 12 · Part 4 — Async & Modules · Modern JavaScript (ES6+) for Beginners
Course: Modern JavaScript (ES6+) for Beginners · Lesson: 12/12 · Read time: ~18 min · Level: Beginner · ES version: ES2015 (ES6) and above

Modules — import/export & What to Learn Next

ES6 modules split code into files with explicit import and export. React, Vue, and modern Node.js all use this system. This is the last core ES6+ topic before you teach Node or React.

Named exports

// utils/math.js
export function add(a, b) { return a + b; }
export const TAX_RATE = 0.18;

// checkout.js
import { add, TAX_RATE } from './utils/math.js';
const total = add(100, 100 * TAX_RATE);

Default export

// services/api.js
export default async function fetchCourses() {
  const res = await fetch('/api/courses');
  return res.json();
}

// app.js
import fetchCourses from './services/api.js';

Re-export & import all

import * as MathUtils from './utils/math.js';
MathUtils.add(2, 3);
🌍 Real-world example — Split LMS helpers into modules
// format.js
export function formatPrice(inr) {
  return `₹${inr.toLocaleString('en-IN')}`;
}

// catalog.js
import { formatPrice } from './format.js';

export function showEbook(ebook) {
  return `${ebook.title} — ${formatPrice(ebook.price)}`;
}

Bonus — modern syntax you will see

// Optional chaining — safe deep access
const city = user?.address?.city;

// Nullish coalescing — default only for null/undefined
const theme = settings.theme ?? 'dark';

// Logical assignment
user.role ||= 'student';

What to learn next on Toolliyo

  1. Review this course — practice each lesson in console
  2. Build a Real-Time Chat App with Node.js — uses async, modules, arrow functions
  3. Node.js Tutorial — full backend path
  4. React Tutorial — components + hooks (needs ES6 first)

Course recap checklist

  • let / const and block scope
  • ✅ Arrow functions and array methods
  • ✅ Template literals, destructuring, spread/rest
  • ✅ Promises and async/await
  • ✅ import / export modules
💡 Tip: In Node.js, save files as .mjs or set "type": "module" in package.json to use import syntax.
⚠️ Common Mistake: Mixing CommonJS require() and ES import in the same file without understanding — pick one module system per project.
👨‍🏫 Teaching note: Final project: split a small “student grade calculator” into 3 files — math.js, format.js, main.js — using named and default exports.
🎓 Congratulations! You finished Modern JavaScript (ES6+) for Beginners. Your students are ready for Node.js and React.

Continue learning

Previous: async/await & Fetch API

Course home: All 12 lessons

Test your knowledge

Quizzes linked to this course—pass to earn certificates.

Browse all quizzes
Modern JavaScript (ES6+) for Beginners

On this page

Named exports Default export Re-export & import all Bonus — modern syntax you will see What to learn next on Toolliyo Course recap checklist Continue learning
Part 1 — Modern Basics
Introduction — Why ES6+ Before Node.js & React let, const & Block Scope Arrow Functions Explained
Part 2 — Write Less Code
Template Literals & Modern Strings Destructuring — Arrays & Objects Spread & Rest Operators (...)
Part 3 — Data & Collections
Default Parameters & Object Shorthand Array Methods — map, filter, find & reduce for...of, Sets & Maps Essentials
Part 4 — Async & Modules
Promises — then, catch & finally async/await & Fetch API Modules — import/export & What to Learn Next
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details