Congratulations!

The full text of this chapter, to read or revisit. To practise, do the exercises.

β–Ά Do the exercises

Exercise 1 β€” You Did It!

Take a moment to appreciate everything you've learned:

Variables, types, strings, numbers, booleans Conditions, loops, functions Arrays, objects, array methods Destructuring, spread, Set & Map Scope, closures, error handling JSON, classes, inheritance And so much more!

You're not just a beginner anymore. You have a solid foundation in JavaScript and programming concepts that apply to ANY language.

Here are a few directions you could explore next.

Exercise 2 β€” The DOM

JavaScript was born in the browser. The DOM (Document Object Model) turns the web page into objects your code can touch: find an element, change its text, react to a click.

const button = document.querySelector("#catch"); button.addEventListener("click", () => { button.textContent = "Caught Zap!"; });

Objects, methods, callbacks β€” nothing new, just pointed at a web page.

Exercise 3 β€” Asynchronous JavaScript

Some things take time β€” a server's answer, a timer. JavaScript never waits for them: it starts the slow operation, carries on, and comes back when the result is ready. That's asynchronous code, written with `async` / `await`:

async function loadTrainer() { const response = await fetch("https://example.com/trainer"); const trainer = await response.json(); console.log(trainer.name); }

`await` pauses only this function, not the whole program. It's the first thing to learn after this course β€” everything on the next pages relies on it.

Exercise 4 β€” Frameworks

Keeping a whole app in sync with the DOM by hand gets messy fast. Frameworks do it for you: you describe what the page should look like, they update it. - React β€” the most popular, built by Meta (Facebook, Instagram, Netflix) - Vue β€” gentle learning curve, loved for its clarity - Svelte β€” the newcomer, less code and very fast You'll also meet TypeScript: JavaScript with types, used by most teams.

Exercise 5 β€” Node.js

Node.js takes the browser's JavaScript engine and runs it anywhere β€” on your computer, on a server. Same language on both sides: that's what full-stack developers do. Netflix, PayPal and Uber run on it. It comes with npm, the largest library collection in the world: one command to install anything.

Exercise 6 β€” APIs & Databases

A server's main job: receive a request, read or save some data, answer with JSON. That's an API, and Express is the classic way to build one in Node.js:

app.get("/codemons", (request, response) => { response.json(team); });

To store data for real, pair it with a database: MongoDB (JSON-like documents) or PostgreSQL (tables and SQL β€” see the SQL course in this app).

Exercise 7 β€” Where to start?

Learn HTML/CSS first (the Web course in this app!), then build one small page in plain JavaScript before picking React. Next, install Node.js and build a tiny Express API β€” a list of your CodΓ©mon β€” and call it from your page with fetch(). That's a real full-stack project, built entirely by you!

Exercise 8 β€” A Message from Prof Pi

Less than 1% of the people who downloaded this app will put in the work to finish this course.

I'm so proud of you for making it this far. Remember: every expert was once a beginner. Keep coding, keep learning, and most importantly β€” have fun!

Back to the course