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.

  • 105 parts
  • ~568 min total
  • Beginner to Intermediate
  • Updated May 2026
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.

We start with strict mode, 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.

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

13 chapters · 105 lessons · ~568 min of reading

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

R&D Engineer

Founder of GoLinuxCloud with over a decade of expertise in Linux, Python, Go, Laravel, DevOps, Kubernetes, Git, Shell scripting, OpenShift, AWS, Networking, and Security. With extensive experience, he excels across development, DevOps, …

  • Red Hat Certified System Administrator in Red Hat OpenStack
  • Certified Kubernetes Application Developer (CKAD)
  • Red Hat Certified Specialist in Ansible Automation
  • Go (programming language)
  • Python (programming language)
  • DevOps
  • Computer Security