Free course · 61 topics · about 80 hours
JavaScript Programming (language in depth)
Ask or find help in JavaScript Programming (language in depth)
Type a question or a word. You get the topics, explanations, meanings and quiz answers that cover it, and each result opens at the right place.
Try:
Your timeline: start to finish
About 12 weeks at 1 hour a day (81 study days) · 0/12 modules done
BeginnerWeeks 1–4
5 topics · 1.8 h of lessons · ~5.4 h with practice · you are here
- Strings, decisions and loopsWeeks 1–2
5 topics · 1.9 h of lessons · ~5.7 h with practice
📝 Module 2 exam: Strings, decisions and loops · 12 questions
- Functions and closuresWeeks 2–3
5 topics · 2.1 h of lessons · ~6.2 h with practice
- Arrays and objectsWeeks 3–4
5 topics · 2.2 h of lessons · ~6.4 h with practice
IntermediateWeeks 4–8
- Scope, this, prototypes and classesWeeks 4–5
5 topics · 2.3 h of lessons · ~6.6 h with practice
📝 Module 5 exam: Scope, this, prototypes and classes · 12 questions
- Modules, errors, JSON and datesWeeks 5–6
5 topics · 2.2 h of lessons · ~6.4 h with practice
📝 Module 6 exam: Modules, errors, JSON and dates · 12 questions
5 topics · 2.3 h of lessons · ~6.6 h with practice
📝 Module 7 exam: Collections, iterators and regular expressions · 12 questions
- Asynchronous JavaScriptWeeks 7–8
6 topics · 2.8 h of lessons · ~8.2 h with practice
ExpertWeeks 8–12
- TypeScript basicsWeeks 8–9
5 topics · 2.3 h of lessons · ~6.6 h with practice
- Functional patterns and testingWeeks 9–10
5 topics · 2.3 h of lessons · ~6.6 h with practice
📝 Module 10 exam: Functional patterns and testing · 12 questions
- Performance and Node.jsWeeks 10–11
5 topics · 2.3 h of lessons · ~6.9 h with practice
- Interview preparation and careerWeeks 11–12
5 topics · 2.4 h of lessons · ~7.1 h with practice
Final exam: JavaScript ProgrammingWeek 12
37 questions · 75 min · pass 70% for the certificate
Weeks count lessons, practice, quizzes and exams (about 80 hours in all), studying every day. Go faster or slower as you like: your place is kept on this device.
0/61 topics done
Beginner
Weeks 1–4. Values, variables, operators, strings, decisions, loops, functions, closures, arrays and objects. After this level you can write and run real programs that process lists of data.
1First steps: values, variables and operators0/5 topics▼
Run JavaScript on your own computer with Node.js, learn the kinds of values the language has, store them in variables and combine them with operators. After this module you can write and run small programs that calculate and compare values correctly, including money.
- How JavaScript runsJavaScript is a programming language that runs inside every web browser and, with Node.js, on any computer or server. A program called an engine reads your code and runs it line by line. You can try code in the browser console, in the Node.js REPL, or by saving it in a .js file and running node file.js.20 min
- Values and typesEvery piece of data in JavaScript is a value, and every value has a type. There are seven primitive types (string, number, bigint, boolean, undefined, null and symbol) plus objects. The typeof operator tells you the type of a value.20 min
- Variables: let, const and varA variable is a name for a value. Use const when the name will always point to the same value, and let when you need to assign a new value later. var is the old way; it ignores blocks and allows confusing mistakes, so avoid it in new code.20 min
- Operators and type coercionOperators combine values: + - * / % ** for maths, === and !== to compare, && || ! for logic, and ?? and ?. to deal with missing values. JavaScript sometimes converts types automatically (coercion), so always compare with === and convert text to numbers yourself.25 min
- Numbers and MathJavaScript has one number type for whole numbers and decimals, stored in a binary format, so 0.1 + 0.2 is not exactly 0.3. For money, calculate in paise (whole numbers) and format only for display. Math gives rounding and other helpers, and BigInt handles huge whole numbers.25 min
2Strings, decisions and loops0/5 topics▼
Work with text, make your program choose between paths with if, switch and the ternary operator, and repeat work with every kind of loop. After this module you can solve everyday problems such as validating input, grading marks and totalling a list.
- Strings and template literalsA string is text inside quotes. Template literals, written with backticks, let you put values inside text with ${...} and span many lines. Strings never change; methods like toUpperCase, slice, trim and split return NEW strings.25 min
- Decisions with if and elseif runs a block of code only when a condition is true; else if and else handle the other cases. Conditions do not have to be true or false: JavaScript treats some values as falsy (like 0, empty text, null and undefined) and everything else as truthy. Early returns keep decision code flat and readable.20 min
- switch, the ternary operator and lookup tablesswitch compares one value against many fixed cases using ===; remember break, or execution falls into the next case. The ternary operator condition ? a : b picks one of two values in a single expression. For long fixed mappings, an object used as a lookup table is often cleaner than both.20 min
- Loops: for, while, do…while, for…of and for…inA loop repeats code. Use for when you count, while when you repeat until something changes, for…of to walk through the items of an array or string, and for…in to walk through the keys of an object. break leaves a loop early and continue skips to the next round.25 min
- Loop patterns that solve real problemsMost loop problems are one of a few patterns: the accumulator (sum or count), the search (find the first match and stop), the best-so-far (min or max), the builder (make a new array or string) and the nested loop (rows and columns). Learn the patterns and new problems become familiar.25 min
3Functions and closures0/5 topics▼
Package code into reusable functions, write arrow functions, handle default and rest parameters, and understand closures, callbacks and recursion. After this module you can split any problem into small, testable functions and read the function-heavy code used in every JavaScript project.
- Functions: declarations, expressions and returnA function is a named, reusable block of code. You define it once and call it many times with different inputs. return sends a value back to the caller; without return a function gives undefined. In JavaScript functions are values, so you can store them in variables and pass them around.25 min
- Arrow functionsArrow functions are a shorter way to write function expressions: (a, b) => a + b. With a single expression after the arrow, the value is returned automatically. Arrows are ideal for small callbacks, but they do not have their own this, so do not use them as object methods that need this.20 min
- Parameters: defaults, rest and options objectsJavaScript does not check how many arguments you pass: missing ones become undefined and extra ones are ignored. Default parameters fill in missing values, rest parameters (...args) collect any number of arguments into an array, and spread (...) does the opposite at the call. An options object with destructuring makes functions with many settings readable.20 min
- Scope and closuresScope decides where a variable can be seen; JavaScript uses lexical scope, so it depends on where the code is written. A closure is a function together with the variables from its surroundings that it remembers, even after the outer function has finished. Closures give you private state, counters and function factories.30 min
- Higher-order functions and recursionA higher-order function takes a function as an argument or returns one; map, filter and setTimeout are examples. Writing your own shows how they work. Recursion is when a function calls itself on a smaller part of the problem, and it always needs a base case that stops it.30 min
4Arrays and objects0/5 topics▼
Store lists in arrays and records in objects, transform data with map, filter and reduce, unpack it with destructuring and spread, and avoid the copy-versus-reference bugs that trip up most beginners. After this module you can process real data such as orders, marks and product lists in a few clear lines.
- Arrays: lists of valuesAn array is an ordered list of values, numbered from 0. You can add and remove items at the end (push, pop) or the start (unshift, shift), cut out parts (slice) and change parts in place (splice). Some methods change the original array and some return a new one, and knowing which is which prevents many bugs.25 min
- Array methods: map, filter, reduce and friendsArray methods replace most hand-written loops. map changes every item, filter keeps the items that pass a test, reduce combines all items into one value, and find, some and every search. Chaining them turns raw data into answers in a few readable lines.30 min
- Objects: keys and valuesAn object groups related values under names called keys (or properties), like { name: "Asha", city: "Pune" }. Read and write properties with dot or bracket notation, add methods, and list keys and values with Object.keys, Object.values and Object.entries. Objects are how JavaScript represents records such as a user, an order or a product.25 min
- Destructuring, spread and restDestructuring unpacks values from arrays and objects into variables in one line: const { name, city } = user. Spread (...) copies the items of an array or the properties of an object into a new one, which is how modern code copies and merges data. Rest (...) collects "everything else" while destructuring.25 min
- References, copies and equalityVariables hold objects and arrays by reference: two names can point to the same object, and === compares whether they are the same object, not whether they look alike. Spread and Object.assign make shallow copies; structuredClone makes deep copies. Knowing this prevents "it changed by itself" bugs.25 min
Intermediate
Weeks 5–8. How the language really works: hoisting, this, prototypes, classes, modules, errors, JSON, dates, collections, regular expressions and asynchronous code. After this level you can read any modern JavaScript codebase and write reliable async code.
1Scope, this, prototypes and classes0/5 topics▼
Understand how JavaScript prepares code before running it (hoisting), how this is decided, how objects inherit through prototypes, and how classes package data with behaviour. After this module you can read and write object-oriented JavaScript and answer the classic interview questions on hoisting, this and prototypes.
- Hoisting and the temporal dead zoneBefore running code, the engine first scans it and creates all the variables and functions of each scope. Function declarations are ready to use from the top; var variables exist from the top but hold undefined; let, const and class exist but cannot be touched until their line runs (the temporal dead zone). This behaviour is called hoisting.25 min
- How this worksthis is a special value inside a function that usually means "the object this function was called on". It is decided by HOW the function is called, not where it is written: obj.method() sets this to obj, a plain call gives undefined in strict mode, new sets it to the new object, and call, apply and bind set it yourself. Arrow functions do not have their own this.30 min
- Prototypes and the prototype chainEvery object has a hidden link to another object called its prototype. When you read a property the object does not have, JavaScript looks in its prototype, then that object's prototype, and so on: this is the prototype chain. It is how arrays get map and push, and how classes share methods.25 min
- ClassesA class is a template for making objects that share the same shape and methods. The constructor sets up each new object, methods are shared on the prototype, #private fields hide data, static members belong to the class itself, and get/set create computed properties. Classes are a cleaner syntax over prototypes, not a new system.30 min
- Inheritance and compositionA class can extend another class to reuse and specialise it: the child calls super() in its constructor and can override methods, calling super.method() to reuse the parent's version. Inheritance models "is-a" relationships; for "has-a" relationships, composition (putting objects inside objects) is usually simpler and more flexible.25 min
2Modules, errors, JSON and dates0/5 topics▼
Split programs into modules, handle errors on purpose instead of crashing, move data in and out as JSON, and work with dates, time zones and Indian number formats correctly. After this module you can build the reliable "plumbing" every real application needs.
- Modules: import and exportA module is a file whose variables are private unless you export them. Other files import what they need. ES modules (import/export) are the standard in browsers and Node.js; older Node code uses CommonJS (require and module.exports). Modules keep large programs organised and avoid name clashes.25 min
- Error handling: try, catch, finally and throwWhen something goes wrong, JavaScript throws an error object that stops normal execution. try/catch lets you catch it and react, finally runs clean-up code either way, and throw lets you raise your own errors with clear messages. Good error handling validates input early, never hides errors silently, and gives users a helpful message.30 min
- JSON: data in and outJSON (JavaScript Object Notation) is a text format for data that every language understands, used by almost every web API. JSON.stringify turns a value into JSON text and JSON.parse turns text back into a value. JSON is stricter than JavaScript: double-quoted keys and strings, no functions, no undefined, no comments and no trailing commas.25 min
- Dates and timesA JavaScript Date is a single moment, stored as milliseconds since 1 January 1970 UTC. Months count from 0 (January is 0), which causes many bugs. Store and send times in UTC (ISO strings), do date maths in milliseconds, and show times in the user's zone, such as IST (UTC+5:30), with Intl.DateTimeFormat.30 min
- Formatting numbers, money and text with IntlThe built-in Intl object formats numbers, currencies, dates, plurals and relative times for any language and region. With the en-IN locale, numbers use the lakh and crore grouping (12,34,567) and INR shows as ₹. Intl.Collator sorts names the way people expect, including accented letters.20 min
3Map, Set, iterators, generators and regular expressions0/5 topics▼
Use Map and Set for fast lookups and unique values, understand the iteration protocol behind for…of, produce values lazily with generators, and search and validate text with regular expressions. After this module you can choose the right collection for a job and validate real inputs like PIN codes and mobile numbers.
- Map and SetA Map stores key-value pairs where the key can be any value, keeps insertion order, and has a size. A Set stores unique values only, which makes removing duplicates and checking membership fast. WeakMap and WeakSet hold objects without stopping them from being garbage-collected.25 min
- Iterators and the iteration protocolfor…of, spread and array destructuring all work through one rule called the iteration protocol. An iterable is an object with a Symbol.iterator method; that method returns an iterator, an object whose next() gives { value, done } each time. Arrays, strings, Maps and Sets are iterable, and you can make your own objects iterable too.25 min
- GeneratorsA generator function, written function*, can pause with yield and resume later. Calling it returns a generator object, which is both an iterator and an iterable. Generators make lazy and even infinite sequences easy to write, such as ID generators or paging through data.25 min
- Regular expressions: the basicsA regular expression (regex) is a pattern that describes text, used to test, find and replace. /^[6-9]\d{9}$/ means "a digit 6 to 9 followed by exactly nine more digits, and nothing else", which checks an Indian mobile number. Learn character classes, quantifiers, anchors and flags, and the methods test, match and replace.30 min
- Regular expressions in practiceGroups (…) capture parts of a match, and named groups (?<year>…) give them readable names. replace can use captured parts ($1 or a function) to reformat text. Quantifiers are greedy by default; add ? to make them lazy. Escape special characters, use the u flag for Unicode, and beware patterns that backtrack forever.30 min
4Asynchronous JavaScript0/6 topics▼
Understand why JavaScript is asynchronous, move from callbacks to promises to async/await, run tasks in parallel safely, predict the order of output with the event loop, and talk to servers with fetch. After this module you can write code that waits for networks, timers and files without freezing, and handle failures and timeouts.
- Why async, and callbacksJavaScript runs your code on one thread, so it must not sit and wait for slow things like the network or a disk. Instead, it starts the slow job and gives it a callback: a function to call when the job is done. Callbacks work, but nesting many of them leads to "callback hell", which promises later fix.25 min
- PromisesA promise is an object that stands for a result that will arrive later. It is pending at first, then becomes fulfilled with a value or rejected with an error, exactly once. You attach then for success, catch for failure and finally for clean-up, and you can chain thens so each step waits for the one before.30 min
- async and awaitasync functions let you write promise code that reads like normal step-by-step code. Inside one, await pauses that function (not the whole program) until a promise settles, and gives you its value or throws its error, which you handle with try/catch. Use Promise.all when independent steps can run at the same time.30 min
- Promise.all, allSettled, race and anyFour helpers combine many promises. Promise.all waits for all and fails fast on the first error; allSettled waits for all and reports each outcome; race settles with whichever settles first (useful for timeouts); any fulfils with the first success. With these you can build timeouts, retries and concurrency limits.25 min
- The event loopThe event loop is how one thread handles many async jobs. Your code runs on the call stack; finished async jobs put callbacks in queues. Whenever the stack is empty, ALL microtasks (promise callbacks) run first, then one macrotask (such as a setTimeout callback). This explains why a promise callback runs before a 0 ms timeout.30 min
- fetch: talking to serversfetch(url, options) sends an HTTP request and returns a promise for a Response. Check response.ok, because fetch does NOT reject on 404 or 500, only on network failure. Read the body with response.json(), send JSON with method, headers and body, and cancel slow requests with an AbortController.30 min
Expert
Weeks 9–12. TypeScript, functional patterns, testing, performance, Node.js and interview preparation. After this level you can write typed, tested, production-quality JavaScript and are ready for interviews.
1TypeScript basics0/5 topics▼
Add types to JavaScript with TypeScript: basic and literal types, object types and interfaces, unions and narrowing, generics and utility types. After this module you can read and write the typed code used in most professional JavaScript teams, and fix the most common TypeScript errors.
- Why TypeScriptTypeScript is JavaScript with types added. You describe what kind of value each variable, parameter and return value holds, and the TypeScript compiler (tsc) checks your code BEFORE it runs, catching typos and wrong values. The types are then removed, so what runs is plain JavaScript.20 min
- Basic types and inferenceThe basic types are string, number, boolean, arrays (number[]), tuples ([string, number]) and literal types like "GET" | "POST". any switches checking off, unknown is the safe "I don't know yet" type, void means "returns nothing" and never means "cannot happen". With strictNullChecks, null and undefined must be written in the type when allowed.25 min
- Object types, interfaces and unionsDescribe object shapes with interface or type, with optional (?) and readonly properties. Union types say a value can be one of several types, and narrowing (typeof, in, equality checks, a shared "kind" field) lets TypeScript know which one you have. A never check makes sure every case of a union is handled.30 min
- GenericsGenerics are type parameters: placeholders like <T> that let one function or type work with many types while keeping them connected. first<T>(list: T[]): T | undefined returns the same type the list holds. Constraints (T extends …) limit what T can be, and keyof lets you talk about an object's property names.30 min
- Utility types and real-world TypeScriptUtility types build new types from existing ones: Partial (all optional), Required, Readonly, Pick and Omit (choose or drop fields), Record (a map type) and ReturnType. as const and satisfies keep literal values precise. In real projects, validate outside data at the boundary and learn to read error messages from the bottom up.30 min
2Functional patterns and testing0/5 topics▼
Write code that is easy to reason about with pure functions and immutable updates, combine small functions with composition and currying, speed things up with memoization, debounce and throttle, and prove your code works with automated tests and test doubles. After this module you can write and test production-quality JavaScript the way professional teams do.
- Pure functions and immutabilityA pure function returns the same output for the same input and changes nothing outside itself. Immutability means you never change existing data; you create updated copies instead. Together they make bugs easier to find, code easier to test, and they are exactly what frameworks like React expect.25 min
- Composition, currying and pipelinesComposition builds a new function by feeding the output of one function into the next. pipe(f, g, h)(x) means h(g(f(x))), which reads like a list of steps. Currying turns a function of several arguments into a chain of one-argument functions, and partial application fixes some arguments in advance.25 min
- Memoization, debounce and throttleMemoization caches a function's results so repeated calls with the same input are instant; it is safe only for pure functions. Debounce waits until calls stop for a moment before running once (perfect for a search box). Throttle runs at most once per time window (perfect for scroll or resize handlers).30 min
- Testing your codeAutomated tests are small programs that check your code gives the right answers, so you can change it without fear. Unit tests check one function, integration tests check parts working together, and end-to-end tests drive the real app. In JavaScript you usually write tests with Vitest or Jest (describe, it, expect) or Node's built-in node:test.30 min
- Test doubles and testable designReal code talks to slow or unpredictable things: servers, databases, the clock, random numbers. In tests you replace them with test doubles: stubs that return fixed answers, spies that record calls, and mocks that check expectations. The easiest way to make this possible is dependency injection: pass those things in as parameters.25 min
3Performance and Node.js0/5 topics▼
Reason about speed with Big-O, measure before optimising, avoid memory leaks, and use Node.js to work with files, build a small HTTP server and set up a real project with npm, environment variables, linting and debugging. After this module you can build and run JavaScript programs outside the browser and keep them fast.
- Performance thinking and Big-OBig-O notation describes how the work a piece of code does grows as its input grows: O(1) stays the same, O(n) grows in step, O(n²) explodes. Replacing an O(n²) nested search with an O(n) Set lookup can turn minutes into milliseconds. But always measure first: most code is fast enough, and guessing wastes time.30 min
- Memory and garbage collectionJavaScript frees memory automatically with a garbage collector, which removes values that can no longer be reached from your code. A memory leak happens when you keep a reference you no longer need: a growing cache, a forgotten timer or event listener, or a closure holding big data. Leaks make long-running apps and servers slow down and crash.25 min
- Node.js basicsNode.js runs JavaScript on servers and computers, and adds built-in modules for files (fs), paths (path), the operating system (os), processes (process) and networking (http). npm installs packages listed in package.json, scripts automate commands, and semantic versions (^1.4.2) control upgrades. Use the LTS release for real projects.30 min
- Files and a tiny server in Nodenode:fs/promises reads and writes files with async functions like readFile and writeFile, and path.join builds safe paths. node:http can start a web server in a few lines: a request handler receives the request and sends a response. For big files, streams process data piece by piece instead of loading it all into memory.30 min
- Real project toolingProfessional JavaScript projects use ESLint to catch mistakes, Prettier to format code the same way for everyone, environment variables (.env files that are never committed) for secrets, a debugger with breakpoints instead of endless console.log, and bundlers like Vite or esbuild for front-end code. TypeScript can be run with tsc, tsx or, in recent Node versions, directly.25 min
4Interview preparation and career0/5 topics▼
Prepare for JavaScript interviews: explain core concepts clearly, trace tricky output questions step by step, write the classic utility functions (debounce, deep clone, flatten, curry, Promise.all), solve common data-structure problems, and plan projects and a job search. After this module you can walk into a JavaScript interview with practised answers and a portfolio to show.
- Core concept questionsMost JavaScript interviews start with concept questions: closures, hoisting, this, == versus ===, prototypes, the event loop, var/let/const, null versus undefined. A strong answer is short: a one-line definition, a tiny example, and one practical consequence. Practise saying them aloud.30 min
- Predict-the-output questionsInterviewers love short snippets that ask "what does this print?". They test type coercion, hoisting, closures in loops, this, sort, and event-loop order. The way to win is not memory but a method: go line by line, write down each value, and apply the rules you learned in this course.30 min
- Classic coding questionsFront-end and Node interviews often ask you to implement small utilities from scratch: debounce, throttle, deep clone, flatten, curry, once, groupBy, and your own Promise.all. Follow a method: clarify the requirements, write examples, code a simple version, test edge cases aloud, then improve.30 min
- Data-structure questions in JavaScriptMost coding rounds include data-structure and algorithm (DSA) problems. A handful of patterns solve the majority: hash maps for counting and lookups (two-sum, anagrams), two pointers on sorted data, sliding windows over subarrays, stacks for matching brackets, and binary search on sorted arrays. Always state the time and space complexity.30 min
- Projects, portfolio and jobsJavaScript skills lead to several roles: frontend developer, Node.js backend developer, full-stack developer, React Native mobile developer and QA automation engineer. To get hired, build three solid projects, keep your code on GitHub with good READMEs, write a focused resume, and prepare for online tests, DSA rounds, machine-coding rounds and HR rounds.25 min
🎓 Final exam and certificate
37 questions, 75 minutes, pass mark 70%. Pass it to get a certificate with your name.