Advanced JavaScript
Advanced JavaScript is not about using the strangest syntax you can find. It is about judgment. You learn how to choose patterns, how the runtime behaves, how JavaScript works outside the browser, and how to check your code with tests and tooling. This part connects language knowledge with project habits. Functional programming teaches you to keep data flow clean. Object-oriented patterns teach you common ways to structure behavior. The under-the-hood chapter gives you mental models for the call stack, hoisting, memory, and task queues. Node.js shows how JavaScript works beyond the page. Testing and code quality show how teams keep code reliable over time. The capstone pulls the book together. It is still a small app, but it asks you to think like a developer: split files, manage state, render from data, handle user actions, persist information, and test the parts that are easy to test. By the end of this part, you should be ready to keep learning from documentation and to approach frameworks with better instincts. Frameworks change. The JavaScript underneath them stays useful.
Chapters
Functional Programming
Functional programming treats functions as the main building blocks of a program. JavaScript is not a purely functional language. You can write object-oriented code, event-driven code, procedural code, or a mix. That is normal. Still, functional habits are useful in everyday JavaScript. They help you write functions that are easier to test, easier to reuse, and easier to reason about when the program grows. The most useful habits are simple: Pass values in. Return values out. Avoid changing outside state unless the function's job is to do that. Create new arrays and objects instead of changing old ones when that makes the data flow clearer. This chapter unpacks those habits one at a time: pure functions, side effects, immutability, higher-order functions, composition, and currying. It also makes the case that a plain loop is sometimes clearer than a clever chain.
Object-Oriented Design Patterns
Design patterns are named solutions to common design problems. They are not magic. They are vocabulary. A pattern can help when the problem is real and the shape fits. It can also make a small program harder to read if you add it too early. This chapter introduces a few patterns that appear often in JavaScript: factory, module, singleton, and observer. You will also see how these patterns relate to closures, classes, browser events, and the capstone project. By the end, you should be able to recognize a pattern without feeling pressured to use it everywhere.
Under the Hood
You can write JavaScript for a long time without knowing every internal detail. Still, a few mental models explain many confusing moments. Why does a stack trace show several function names? Why can a function declaration be called before it appears? Why does a promise callback run before a timer? Why does a program keep using memory after you thought a value was gone? This chapter gives you enough of the model to reason about those questions without turning the book into engine documentation.
JavaScript Beyond the Browser
JavaScript started in browsers, but it does not stay there. Node.js runs JavaScript outside the browser. With Node, JavaScript can read files, write files, run command line tools, start servers, run tests, automate tasks, and use packages from npm. The language is still JavaScript. The environment is different. In a browser, you have `document`, `window`, DOM events, and browser storage. In Node.js, you have file system APIs, process information, server modules, and access to installed packages. This chapter stays on the Node side of that line: running JavaScript with Node, setting up a small npm project, using ES modules, reading and writing files, working with JSON, standing up a simple HTTP server, and avoiding the mistakes that catch people new to Node.
Testing and Code Quality
Testing checks whether code behaves the way you expect. You already test manually. Every time you run a program, click a button, add a task, or refresh a page to see whether storage worked, you are testing. Automated tests let the computer repeat specific checks for you. Code quality tools help with a different problem. Formatters keep layout consistent. Linters warn about likely mistakes. Together, tests and quality tools make a project easier to change without guessing what broke. This chapter covers writing small tests with Node's built-in test runner, choosing test cases that are worth writing, testing pure helpers, reading a failure when one shows up, and where formatters and linters fit in.
Capstone Project: Full Interactive Web App
The capstone brings the book together. You will build a small study tracker. It stores topics, marks them complete, filters them, saves them in the browser, and keeps the code split into modules. This project is intentionally small. The point is not the app idea. The point is seeing how values, functions, arrays, objects, DOM work, events, modules, storage, validation, error handling, and tests fit together. Build it in passes. Each pass should leave the app working. When you are done, you will have a complete browser app plus a set of pure helper functions you can test outside the browser.