Free coding practice with hints that help
Write real JavaScript, run the tests, and when something fails, get a hint about what your code actually did. Everything runs in your browser. No account, no install, no cost.
1function fizzBuzz(n) {2 const result = [];3 for (let i = 1; i <= n; i++) {4 if (i % 3 === 0) result.push("Fizz");5 else if (i % 5 === 0) result.push("Buzz");6 else if (i % 15 === 0) result.push("FizzBuzz");7 else result.push(String(i));8 }9 return result;10}
2 of 3 tests passed
- fizzBuzz(5)
- fizzBuzz(1)
- fizzBuzz(15) · item 15 is "Fizz"
What the tests saw
Your 15 says "Fizz". Check for multiples of both 3 and 5 before checking 3 on its own.
Practice that tells you why
Real tests
Hints from your code
Hints one at a time
Plain error messages
Loop protection
Warm-up to medium
Saved on your device
Private by design
The exercises
Open the playground- 01
Add two numbers
Warm-up · functions and return
- 02
Even or odd
Warm-up · the remainder operator
- 03
Largest number in a list
Easy · loops and tracking a value
- 04
Reverse a string
Easy · strings and arrays
- 05
Count the vowels
Easy · loops and conditions
- 06
FizzBuzz
Medium · loops, conditions and order of checks
- 07
Palindrome check
Medium · cleaning input, comparing strings
- 08
Factorial
Medium · loops or recursion
- 09
Remove duplicates
Medium · arrays and Set
- 10
Count words
Medium · objects as counters
Guides for beginners
All guidesHow to learn to code for free: a plan for beginners
What to learn first, how much to practise, and how to tell you are making progress, without paying for a course.
JavaScript functions for beginners
Parameters, return values and the mistake almost everyone makes first: printing instead of returning.
How to read JavaScript error messages
SyntaxError, ReferenceError and TypeError in plain words, with the usual cause and fix for each.
Stuck on a coding exercise? A step-by-step method
Read the failing test, trace one input by hand, and use hints one at a time so you still learn.