JavaScript Course

The language that makes websites interactive.

Add interactivity to web pages. Learn DOM manipulation, events, async/await, fetch API, and ES6+ features.

Level: Beginner · 115 lessons · Start lesson 1 · Interview questions

Curriculum

  1. JavaScript Introduction — Meet JavaScript — the language that runs every modern website, mobile app, and Node.js server.
  2. JavaScript Get Started — Run JS in the browser console, or install Node.js for the terminal.
  3. JS Input & Output — Browser dialogs (`alert`, `prompt`, `confirm`) for input, and the five ways JS shows output — `console.log`, `alert`, `document.write`, `innerHTML`, `window.print`.
  4. JavaScript Where To — External vs internal <script>, where to place them, and why <script defer> wins.
  5. JS How JavaScript Works (Browser + Engine) — Inside V8 — parsing, JIT, the call stack, and the event loop in 60 seconds.
  6. JS Setup — Browser & Node.js — Run JS in DevTools, in a `<script>` tag, and on the command line with Node.js.
  7. JS Statements — Expressions, statements, semicolons, automatic semicolon insertion (ASI).
  8. JS Comments — Single-line `//`, multi-line `/* */`, and JSDoc `/** */` for your IDE.
  9. JavaScript Variables — let, const, var — what to use, when, and why.
  10. JavaScript Data Types — The 7 primitives + objects, and the truth about typeof.
  11. JS Type Conversion — Implicit coercion (`+`, `==`) and explicit conversion (`Number()`, `String()`, `Boolean()`).
  12. JavaScript Operators — Arithmetic, comparison, logical, plus the modern `??`, `?.`, and spread.
  13. JS Strict Mode — Opt into safer JS with `'use strict';` — silent errors become real ones.
  14. JavaScript If / Else & Switch — Branching with truthy/falsy, ternary, and the modern switch patterns.
  15. JavaScript Loops — for, for...of, for...in, while — and the modern functional alternatives.
  16. JS Switch — Match one value against many constants — case, break, default, fall-through.
  17. JS Ternary Operator — The one-liner conditional — `cond ? a : b` for short, value-returning branches.
  18. JS Logical Operators — `&&`, `||`, `!`, plus the modern `??` (nullish coalescing) and `?.` (optional chaining).
  19. JS Nested Conditions — When `if` lives inside `if` — flatten with early returns or guards.
  20. JavaScript Functions — Function declarations, arrows, default params, rest, and closures.
  21. JS Function Declaration — `function name(...) { ... }` — hoisted, classic, named.
  22. JS Function Expression — Functions stored in variables — `const f = function() { ... }`. Not hoisted.
  23. JS Arrow Functions — `(a, b) => a + b` — concise syntax, lexical `this`. The modern default for callbacks.
  24. JS Parameters & Arguments — What goes in: positional, default, rest, destructured.
  25. JS Return Statement — Exit a function and produce a value. Without `return`, functions return `undefined`.
  26. JS Default Parameters — Provide fallback values when an argument is omitted or `undefined`.
  27. JS Rest Parameters — `...args` — collect any number of trailing arguments into an array.
  28. JS Callback Functions — Pass a function to another function — the foundation of async, events, and array methods.
  29. JS Recursion — A function that calls itself — base case + recursive case + the call stack.
  30. JS Window Object — The browser's top-level global — `window.location`, `window.history`, `window.alert`.
  31. JS Timers (setTimeout, setInterval) — Schedule code: `setTimeout(fn, ms)` once, `setInterval(fn, ms)` repeating, `clear*` to cancel.
  32. JS Local Storage / Session Storage — Key-value persistence in the browser — survives reload (localStorage) or tab-close (sessionStorage).
  33. JS Cookies — Small key-value pairs sent with every HTTP request — auth, sessions, preferences.
  34. JS Geolocation API — Get the user's coordinates with permission — `navigator.geolocation.getCurrentPosition`.
  35. JavaScript Arrays — Iteration, map / filter / reduce, and the modern toolset that beats for loops.
  36. JS Creating Arrays — Literals, `Array.of`, `Array.from`, `new Array(n)` — and when each one applies.
  37. JS Array Methods (push, pop, shift, unshift) — The four classic mutators — modify the array in place.
  38. JS Looping Arrays — `for`, `for...of`, `forEach`, plus the modern `entries()` for index + value.
  39. JS Higher-Order Methods (map, filter, reduce) — Functional iteration — transform, select, and accumulate without explicit loops.
  40. JS Array Destructuring — Pull values out of arrays into named variables — `const [a, b] = arr`.
  41. JS Spread Operator — `...arr` — expand an iterable into individual elements. Copies, merges, splats.
  42. JavaScript Strings — Template literals, methods, and the deep truth that strings are immutable.
  43. JS String Methods — `.length`, `.toUpperCase`, `.includes`, `.slice`, `.replace` — the daily-driver string toolkit.
  44. JS Template Literals — Backticks with `${}` placeholders + multi-line strings + tagged templates.
  45. JS String Search Methods — `indexOf`, `includes`, `startsWith`, `endsWith`, `match`, `matchAll` — find substrings & patterns.
  46. JS String Manipulation — Build, slice, replace, format — common idioms for transforming text.
  47. JavaScript Objects — Property access, destructuring, and the modern shorthand syntax.
  48. JS Object Properties — Read, write, delete, dynamic keys, computed property names.
  49. JS Object Methods — Functions stored as object properties — `obj.greet()`, shorthand, and `this`.
  50. JS this Keyword — What `this` refers to depends on HOW the function is called.
  51. JS Object Destructuring — Pull named fields out of objects — `const { x, y } = point`.
  52. JS Optional Chaining — `?.` — short-circuit on `null`/`undefined` instead of crashing.
  53. JS Object.keys / values / entries — Iterate objects safely — get keys, values, or [key, value] pairs as arrays.
  54. JavaScript DOM Basics — Selecting elements, changing content, handling events — the bread of front-end JS.
  55. JS Selecting Elements — `querySelector`, `querySelectorAll`, `getElementById` — find DOM nodes.
  56. JS Changing Content — `textContent`, `innerHTML`, `innerText` — read and write what users see.
  57. JS Changing Styles — `element.style`, `classList`, CSS variables — three ways to update visuals.
  58. JS Creating & Removing Elements — `createElement`, `appendChild`, `remove` — build the DOM dynamically.
  59. JS Traversing the DOM — Move between nodes — parents, children, siblings.
  60. JS Forms Handling — Read inputs, prevent default, validate, submit via fetch — the modern form workflow.
  61. JS Event Basics — What an event is, the event object, and the click → handler lifecycle.
  62. JS Event Listeners — `addEventListener`, `removeEventListener`, options like `{ once, passive, capture }`.
  63. JS Mouse Events — `click`, `dblclick`, `mouseenter`, `mouseleave`, `mousemove` — pointer interactions.
  64. JS Keyboard Events — `keydown`, `keyup`, `keypress` (deprecated) — capture key presses with modifier flags.
  65. JS Form Events — `submit`, `change`, `input`, `focus`, `blur` — react to user form interactions.
  66. JS Event Bubbling & Capturing — Click a button — click events flow capture (root → target) then bubble (target → root).
  67. JS Event Delegation — One listener on a parent handles clicks for many children — including future ones.
  68. JS let & const — Block-scoped declarations — `let` for changing, `const` for fixed references.
  69. JS Modules (import/export) — Split code into files — `export` what you publish, `import` what you use.
  70. JS Classes — Syntactic sugar over prototypes — `class`, `constructor`, methods, `extends`, `super`.
  71. JS Promises (Intro) — An object representing a future value — `pending → fulfilled / rejected`.
  72. JavaScript Async / Await — Promises, async/await, and the event loop made approachable.
  73. JavaScript Fetch & JSON — Talk to APIs with fetch + async/await — the modern way to load data.
  74. JS Callbacks — Pass a function to be called later — the original async pattern.
  75. JS Callback Hell — Nested callbacks form a pyramid that's hard to read. Promises and `async/await` are the cure.
  76. JS Promises — Deep dive: chaining, error propagation, `Promise.all`, `Promise.race`, and parallel execution.
  77. JS Fetch API — The modern HTTP client built into the browser & Node.js — `fetch(url, options)`.
  78. JS Error Handling (async) — `try/catch` with `await`, error boundaries, retry-with-backoff.
  79. JS Types of Errors — Built-in error classes: SyntaxError, TypeError, ReferenceError, RangeError.
  80. JS try...catch — Synchronous error handling — wrap risky code, recover gracefully.
  81. JS throw — Manually raise an error — `throw new Error(msg)` is the canonical form.
  82. JS finally — Code that runs whether the try block succeeds or fails — perfect for cleanup.
  83. JS Debugging (console + dev tools) — DevTools workflow — breakpoints, watch, step, network, performance.
  84. JS Objects & Prototypes — Every JS object has a `__proto__` chain — that's how methods are inherited.
  85. JS Constructor Functions — Pre-class JS — `function User(name) { this.name = name; }` + `new`.
  86. JS Inheritance — `extends` + `super` — classes derive from classes, share methods through the prototype chain.
  87. JS Encapsulation — Hide internal state with closures or `#private` fields (ES2022).
  88. JS Polymorphism — Same method, different behaviour per class — duck typing in JS.
  89. JS Closures — A function that 'remembers' variables from the scope it was created in.
  90. JS Hoisting — Why you can call `function foo()` before it appears — and why `let` and `const` throw.
  91. JS Execution Context — Each function call gets its own context: variables, `this`, scope chain.
  92. JS Event Loop — Tasks, microtasks, and how JS stays responsive even though it's single-threaded.
  93. JS Call Stack — The LIFO stack of function calls — how JS knows where to return.
  94. JS Memory Management — Garbage collection — JS frees memory when nothing references it. Watch out for leaks.
  95. JS Scope (Global, Local, Block) — Where a name is visible — global, function, block. Lexical scoping is JS's foundation.
  96. JavaScript Modules — export / import, default exports, and the modern ESM way.
  97. JS ES Modules — The native module system — import/export, .mjs / type: "module".
  98. JS Bundlers (Webpack / Vite) — Combine many modules into a few optimised bundles for the browser.
  99. JS Package Managers (npm / yarn / pnpm) — `package.json` + a registry = reusable packages. Three managers, same job.
  100. JS Code Splitting — Load less code upfront — split bundles by route, by feature, by user.
  101. JS XSS Basics — Cross-Site Scripting — when user input gets rendered as HTML/JS, attackers steal sessions.
  102. JS CSRF Basics — Cross-Site Request Forgery — your logged-in cookies sent on a malicious site's request.
  103. JS Performance Optimization — Measure first — DevTools, Lighthouse — then fix the slow parts.
  104. JS Debouncing & Throttling — Tame floods of events — fire only once per N ms, or only after a quiet period.
  105. JS Unit Testing Basics — Test small functions in isolation — `assert(actual === expected)`.
  106. JS Jest Introduction — Most popular JS testing framework — `describe`, `test`, `expect`.
  107. JS Debugging Techniques — Beyond `console.log` — breakpoints, step debugging, stack traces, log points.
  108. JS Project — To-Do App — Add, complete, delete tasks. State in localStorage. The classic JS starter.
  109. JS Project — Calculator — Buttons + display. Handle operators, precedence, and the `=` button.
  110. JS Project — Weather App (API) — Search a city → fetch weather → display. Real API + async/await + error handling.
  111. JS Project — Quiz App — Show questions, score answers, render results. Great for arrays + state.
  112. JS Project — Notes App — Markdown notes with localStorage, search, and export.
  113. JS Project — Mini E-commerce — Product list → cart → checkout. State management + localStorage cart + Stripe (optional).
  114. JavaScript Exam Questions — JS theory + programs + ES6 + DOM — full exam preparation.
  115. Viva Questions — 20 short JavaScript viva Q&A.