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