JavaScript for Beginners
Variables, functions, arrays, objects, the DOM and async code
Technology & ProgrammingCode real browser games with variables, loops, canvas drawing, keys and collisions
Finish the 11 lessons (about 2 h) and pass the 20-question final exam. Your Certificate of Completion is ready the moment you pass.
Every game you have ever played, from a simple snake game to a huge open world, runs on the same core ideas: numbers that remember the state of the game, rules that check what's happening, a loop that runs many times per second, and code that reacts when you press a key. This free course teaches you those ideas by using them to build games that run in a web browser.
You'll use JavaScript, the language built into every browser, so there's nothing to buy and almost nothing to install. You'll start with variables for score and lives, then write the rules of a game with if statements. Next you'll learn loops and functions, the tools that keep game code short, and arrays and objects for storing players, enemies and high scores.
Then the fun part: drawing on an HTML canvas, understanding why the y axis points down, and making things move smoothly with an animation loop. You'll add keyboard controls, detect when two objects collide, use randomness to spawn enemies and power-ups, and wire it all together into a complete catch-the-falling-stars game with a score and a game-over screen.
The course is designed for teens who are new to coding, though anyone who wants a playful start is welcome. Every lesson includes small coding challenges you solve right on the page, with automatic tests that tell you if your code works, plus quick checks that make sure the ideas stick. Pass the final exam to earn a free certificate of completion and keep building your own games.
Learn how games remember things with variables and decide what happens with if statements and comparisons.
Repeat actions without copying code, and package game actions into reusable functions with inputs and return values.
Store many things at once with arrays and describe game characters with objects, the two data structures every game is built on.
Draw shapes on an HTML canvas, understand its upside-down coordinate system, and make things move with a game loop, velocity and gravity.
Let players steer with the keyboard, detect when objects touch, add randomness, and assemble everything into a finished game with a score and game over.
20 questions drawn from a pool of 33. Score 70% or more to pass; retakes get a fresh set of questions.
In JavaScript, the line x = x + 1 is a mistake because x can never equal x + 1.
True or false?
Answer: False
A single equals sign means assignment, not equality. The line calculates x + 1 and stores it back in x, which increases x by one. Comparing for equality uses three equals signs, which you'll meet in the next lesson.
Only a tiny bit. A canvas game needs one short HTML file with a canvas element and a script tag, and this course shows you that file. Everything else happens in JavaScript.
Yes, especially for 2D games. It runs in every browser, you see results instantly, and sharing a game is as easy as sending a link. Professional studios often use other languages for big 3D games, but the core ideas you learn here, like game loops and collision checks, carry over to any language or engine.
Just a web browser and a text editor. A free code editor such as Visual Studio Code makes life easier, and online playgrounds let you code games without installing anything at all.
Scratch is great for learning logic with drag-and-drop blocks. JavaScript is typed text, which is what professional developers use. If you've used Scratch, you'll recognize loops, if blocks and variables; here you'll write them yourself and gain much more control.
Many people publish browser games on game portals or turn them into mobile apps with extra tools. Start by finishing small games and sharing them with friends; finishing a game is the skill that matters most.
Try adding sound, sprite images and levels to your game, then explore a beginner-friendly game framework such as Phaser. Learning more about functions, arrays and objects will make every bigger project easier.
Variables, functions, arrays, objects, the DOM and async code
Technology & ProgrammingWrite real programs: games, quizzes and calculators from your first line of code
Technology & ProgrammingAlgorithms, loops, if-then, variables and bug hunting, then write real JavaScript
Technology & ProgrammingWrite real programs with variables, loops, lists, dictionaries and functions
Technology & ProgrammingMatch, extract and replace text with regex in JavaScript, Python and your editor
Technology & ProgrammingTrack changes, branch safely and collaborate with pull requests
Technology & Programming