JavaScript 1 Practice
Use it. Then build it.
Start with small changes, then gradually do more yourself. If you get stuck, use the toolbox or open a hint. The goal is not memorising everything at once.
Beginner?
Start at Challenge 1. The support slowly disappears as you get stronger.
Experienced?
Try the Quick Check. If it is easy, jump to the Mastery Challenge and Bonus Lab.
Toolbox
JavaScript 1 Patterns
Here is one complete program so you can see how the pieces fit. Need one skill while practising? Copy just that pattern.
Experienced? Start Here
Quick Skill Check
Try these without the toolbox. If all four are easy, skip ahead.
1. GreetingAsk a name and alert Welcome NAME!.
2. MathsStore 8 and 6, multiply them, alert the answer.
3. DecisionAsk What is 4 + 5? and respond Correct / Wrong.
4. ComparisonAsk for a score. Unlock at 100 or more.
ResultNothing runs until RUN
Core Practice
Gradually take off the training wheels
The early exercises give you more help. Later ones make you remember and combine the same skills yourself.
Challenge 1 · Modify
Personal Welcome
Lots of support
The program already works. Make it yours.
Goal
Ask name→Welcome NAME to Dino Run!
ResultChange the final message
Change only the final alert so it says something like Welcome Daniel to Dino Run!
Challenge 2 · Complete
Finish the Greeting Machine
Still guided
Now one important line is incomplete.
Hint
What variable did you store the player's name in?
Challenge 3 · Build from comments
Game Profile
Medium support
The comments tell you what each line should do. You write the JavaScript.
Target behavior
Ask name→Ask favourite game→Show both in one alert
ResultExample: Daniel likes Minecraft
Need a nudge?
You need two prompt() lines and one alert().
Challenge 4 · Maths
Area Calculator
Medium support
Most of the structure is there. You decide the calculation.
Result5 × 4 should give 20
Challenge 5 · Comparison Symbols
Fill in the missing symbol
Quick logic check
Choose the symbol that matches each rule. No full program yet.
Choose from:
== != < <= > >=
score ___ 100The level unlocks at 100 or more.
lives ___ 0Continue if lives are not equal to 0.
age ___ 10Only players younger than 10.
Check answers
score >= 100
lives != 0
age < 10
Challenge 6 · Complete if / else
Unlock the Level
Less support
Rule100 or more unlocks it
Challenge 7 · Debug
Repair the Broken Quiz
Read code carefully
This is not about memory. It is about spotting what looks wrong.
What kind of mistakes?
Look for quotes and brackets. Also compare the if line with the toolbox.
Challenge 8 · Build from requirements
Secret Word
Almost independent
Your program must:
- ask for a secret word
- store the answer
- use
if / else
- say ACCESS GRANTED if correct
- say ACCESS DENIED otherwise
ResultYou choose the password
Need the structure?
let answer = prompt(...)
Then use if (...) { } else { }.
JS 1 MASTERY
Build a Guessing Game
Now put the main JavaScript 1 skills together with very little help.
Requirements
- choose a secret number
- ask the player to guess
- store the guess
- use
if / else
- alert a correct or wrong message
ResultCan someone else play it?
Hint 1
You need prompt, a variable and if / else.
Hint 2
let guess = prompt(...);
if (guess == ...) {
} else {
}
Bonus Lab · Experienced Coders
Same skills, more interesting combinations
These do not require new JavaScript. They require more planning.
Bonus A
Two-question quiz
Ask two questions and check each answer separately.
Bonus B
Mission admission
Ask the player's name and score, then decide whether the mission unlocks.
Bonus C
Choose a route
Make a tiny branching story using prompt, variables, if/else and alert.
Bonus A · Build
Two-question Quiz
Ask two questions. Check each one with its own if / else. Make the questions your own.
Bonus B · Logic
Mission Admission
Target behavior
Ask name→Ask score→100+ accepted→under 100 train more
Bonus C · Creative
Choose a Route
Ask the player to choose something such as forest or mountain. Give a different outcome for each choice.
JavaScript 1 complete
If you can build the guessing game without copying a full solution, you are ready for JavaScript 2 and controlling actual HTML elements.