Welcome to JavaScript Quest!
What does a programming language look like in practice? In this lesson, you’ll read and run short JavaScript examples to see how a web browser follows the instructions in the code.
You’ll explore how JavaScript displays messages, how variables store values, and how code can change what appears on a webpage. You’ll also see how comments help people understand the code.
You don’t need to memorize JavaScript syntax. Keep the examples handy as you work. Focus on what each instruction does and what happens when the browser runs it.
Each activity includes questions to check your understanding. If the activity includes a code example, you must select Run before you can answer its questions. If you miss a question, wait 45 seconds after checking your answers. Then select Retry to answer the activity’s questions again.
Completed code
Select Run to see the example and unlock the questions.
Browser window
Open example in a new tabJavaScript alert
Hello, World! I'm learning JavaScript!
Check your understanding
Quest complete
Download your certificate
Enter the name you want on your certificate. Your certificate downloads as a PDF.
The lesson is complete. You can play the dice game for fun. It doesn’t affect your score.
On a shared computer, submit your certificate or save it to your own storage, then remove the copy in Downloads.
Roll for Doubles
Roll two dice. If they match, you win. Play as many times as you like.
Ready to roll.
See the JavaScript for the visual dice
The game picks two random positions in a list of dice faces. If the positions match, the faces match and you win.