Free Online Course · Self-paced

Modern JavaScript Tutorial (ES6+ Hands-On)

Free, hands-on JavaScript tutorial - strings, numbers, arrays, objects, ES6+ features, classes, async/await, the DOM, error handling, and common error fixes. 75+ runnable lessons covering modern JavaScript. Each linked article states what to expect when you run its snippets in Node or the browser.

  • 122 parts
  • ~418 min total
  • Beginner to Intermediate
  • Updated Jun 2026
Reviewed Deepak Prasad
Modern JavaScript Tutorial (ES6+ Hands-On)
By Last updated

JavaScript is the only language that runs natively in every browser, and increasingly the most popular language on servers (via Node.js) too. This tutorial covers modern JavaScript - ES6 and later - the way you will actually write it in real codebases. We skip the legacy quirks where possible and focus on idiomatic, current syntax.

Roadmap diagram: example clusters of JavaScript topics from syntax through async DOM and tooling as a learning graph

We start with strict mode in JavaScript, scope, and the equality rules (== vs ===), then walk through every core data type (numbers, strings, arrays, objects), modern syntax (arrow functions, template literals, destructuring, spread, nullish coalescing), classes and design patterns, async with Promises and async/await, DOM manipulation, error handling, and finally a chapter dedicated to fixing the most common JavaScript errors you will hit. Every snippet runs in the browser console or Node.js REPL with zero setup.

The chapter list on this page is the full course index: every JavaScript lesson is linked here. On other JavaScript pages, the sidebar shows a shorter spine of core topics in learning order so navigation stays light; use this hub whenever you need the complete list—including method deep-dives, jQuery, design patterns, and troubleshooting fixes.

Click Start the course to begin, or jump to the chapter you need - Arrays, Async, and DOM Manipulation are the most-bookmarked. When you finish, the next course is /nodejs-tutorial/ for server-side JavaScript.

What you'll learn

  • Write modern ES6+ JavaScript - let/const, arrow functions, template literals, destructuring, spread
  • Work fluently with strings, numbers, arrays, and objects using the right method for each job
  • Build classes with inheritance and apply singleton / observer / mediator patterns correctly
  • Handle async code with Promises, async/await, and chained then() without footguns
  • Manipulate the DOM, handle events, and build interactive UIs without a framework
  • Debug the most common JavaScript errors (call stack, undefined, module imports, headers)

Prerequisites

  • Any modern browser (Chrome/Firefox/Edge) with DevTools
  • Node.js LTS installed (optional but recommended for running snippets)
  • Basic HTML/CSS knowledge for the DOM chapter

Syllabus

14 chapters · 122 lessons · ~418 min of reading

  1. 1 Getting Started 5 lessons
    1. Part 1 use strict mode 2 min read
    2. Part 2 Global variables and scope 5 min read
    3. Part 3 == vs === - the equality rules 6 min read
    4. Part 4 Check if a variable is undefined 4 min read
    5. Part 5 Calling vs invoking a function 3 min read
  2. 2 Numbers and Math 15 lessons
    1. Part 6 Math.abs() 2 min read
    2. Part 7 Math.ceil() 2 min read
    3. Part 8 Math.floor() 2 min read
    4. Part 9 Math.pow() and exponents 2 min read
    5. Part 10 Exponentiation in JavaScript 5 min read
    6. Part 11 Number.toFixed() 2 min read
    7. Part 12 Math.random() 3 min read
    8. Part 13 Math.sqrt() 2 min read
    9. Part 14 Math.max() 2 min read
    10. Part 15 Math.min() 2 min read
    11. Part 16 Math.cbrt() 2 min read
    12. Part 17 Math.fround() 2 min read
    13. Part 18 Round down a number 2 min read
    14. Part 19 Integer division 8 min read
    15. Part 20 <= operator 2 min read
  3. 3 Strings 17 lessons
    1. Part 21 Template literals (backticks) 3 min read
    2. Part 22 String.includes() - contains check 2 min read
    3. Part 23 String.startsWith() 2 min read
    4. Part 24 String.trim() 2 min read
    5. Part 25 String.toLowerCase() 2 min read
    6. Part 26 String.indexOf() 4 min read
    7. Part 27 Replace a substring 3 min read
    8. Part 28 String.replaceAll() 2 min read
    9. Part 29 replaceAll() with regex patterns 2 min read
    10. Part 30 String.trimEnd() 2 min read
    11. Part 31 Variables inside regex patterns 2 min read
    12. Part 32 Convert SRT subtitles to plain text 4 min read
    13. Part 33 Remove the last character of a string 3 min read
    14. Part 34 Convert a string to an array 5 min read
    15. Part 35 Compare strings 6 min read
    16. Part 36 Check if a string is a number 5 min read
    17. Part 37 Validate an email address 2 min read
  4. 4 Arrays 16 lessons
    1. Part 38 Add an item to an array 4 min read
    2. Part 39 Array.pop() 3 min read
    3. Part 40 Array.unshift() 3 min read
    4. Part 41 Slice an array 4 min read
    5. Part 42 slice() method reference 2 min read
    6. Part 43 Array.splice() 2 min read
    7. Part 44 Array.join() 6 min read
    8. Part 45 Copy an array 6 min read
    9. Part 46 Remove duplicates from an array 2 min read
    10. Part 47 Remove a specific element 2 min read
    11. Part 48 Flatten a nested array 4 min read
    12. Part 49 Check if an array is empty 4 min read
    13. Part 50 Spread operator (...) 2 min read
    14. Part 51 Sort an array 2 min read
    15. Part 52 Array.findIndex() 4 min read
    16. Part 53 Set and HashSet-style uniqueness 4 min read
  5. 5 Data structures, DOM utilities, and patterns 7 lessons
    1. Part 54 Linked list implementation 4 min read
    2. Part 55 Infinite loops (intentional and accidental) 4 min read
    3. Part 56 XOR operator and bitwise patterns 2 min read
    4. Part 57 Create and manipulate SVG 2 min read
    5. Part 58 Detect ad blockers in the browser 5 min read
    6. Part 59 Simulate Tab key events 2 min read
    7. Part 60 Conditional logic with jQuery 2 min read
  6. 6 Objects, JSON, Destructuring 9 lessons
    1. Part 61 Object literals 4 min read
    2. Part 62 Check if a key exists in an object 7 min read
    3. Part 63 Object.hasOwnProperty() 4 min read
    4. Part 64 Clone an object 5 min read
    5. Part 65 Deep copy an object 7 min read
    6. Part 66 Merge objects 3 min read
    7. Part 67 Object and array destructuring 7 min read
    8. Part 68 JSON.stringify() with pretty-print 2 min read
    9. Part 69 JSON.parse() 2 min read
  7. 7 Functions 5 lessons
    1. Part 70 Arrow functions 4 min read
    2. Part 71 The arguments object 4 min read
    3. Part 72 Optional parameters and defaults 2 min read
    4. Part 73 Functions as values (first-class) 5 min read
    5. Part 74 Recursion (factorial example) 3 min read
  8. 8 Control Flow and Loops 5 lessons
    1. Part 75 Nullish coalescing (??) 5 min read
    2. Part 76 Double-negation (!!) for boolean coercion 5 min read
    3. Part 77 forEach vs for...in vs for...of 7 min read
    4. Part 78 Loop through an object's keys 4 min read
    5. Part 79 for loop with index 2 min read
  9. 9 Classes and OOP 5 lessons
    1. Part 80 JavaScript classes 5 min read
    2. Part 81 Subclasses and extends 3 min read
    3. Part 82 instanceof operator 3 min read
    4. Part 83 Singleton pattern 2 min read
    5. Part 84 Observer pattern 3 min read
  10. 10 Async - Promises and async/await 10 lessons
    1. Part 85 async / await 4 min read
    2. Part 86 Promise.all() 2 min read
    3. Part 87 Promise.race() 4 min read
    4. Part 88 Promise.resolve() 3 min read
    5. Part 89 Promise.reject() 3 min read
    6. Part 90 Chain promises with .then() 2 min read
    7. Part 91 Wait for async work to finish 2 min read
    8. Part 92 setTimeout() 4 min read
    9. Part 93 Wait N seconds in JavaScript 2 min read
    10. Part 94 Run a function every second (setInterval) 4 min read
  11. 11 Date and Time 5 lessons
    1. Part 95 Get the current date 5 min read
    2. Part 96 Add days to a date 4 min read
    3. Part 97 Format dates 6 min read
    4. Part 98 Convert a date to ISO string 2 min read
    5. Part 99 Compare dates 2 min read
  12. 12 DOM Manipulation and Events 15 lessons
    1. Part 100 Get a DOM element 3 min read
    2. Part 101 querySelector / querySelectorAll 3 min read
    3. Part 102 Get and set textContent 3 min read
    4. Part 103 Element.replaceWith() 2 min read
    5. Part 104 Remove a DOM element 3 min read
    6. Part 105 Node.appendChild() 4 min read
    7. Part 106 Node.insertBefore() 4 min read
    8. Part 107 window.scrollTo() 2 min read
    9. Part 108 Redirect to a URL 3 min read
    10. Part 109 Open a new tab from JS 3 min read
    11. Part 110 addEventListener() 6 min read
    12. Part 111 Keyboard events 6 min read
    13. Part 112 Mouse events 3 min read
    14. Part 113 Event bubbling explained 4 min read
    15. Part 114 Copy to clipboard 4 min read
  13. 13 Error Handling 3 lessons
    1. Part 115 try / catch / finally 3 min read
    2. Part 116 return vs throw 3 min read
    3. Part 117 Throw custom errors 2 min read
  14. 14 Common Errors and Troubleshooting 5 lessons
    1. Part 118 Fix: Cannot use import statement outside a module 6 min read
    2. Part 119 Fix: Maximum call stack size exceeded 2 min read
    3. Part 120 Fix: Cannot set headers after they are sent 8 min read
    4. Part 121 Fix: Objects are not valid as a React child 3 min read
    5. Part 122 Fix: ipython is not defined 5 min read
Deepak Prasad

R&D Engineer

Founder of GoLinuxCloud with more than 15 years of expertise in Linux, Python, Go, Laravel, DevOps, Kubernetes, Git, Shell scripting, OpenShift, AWS, Networking, and Security. With extensive …