iwantcoding.com
🔥 Daily 👥 Rooms 🏆 Top Log in Sign up

JS Exercises

Each JavaScript lesson page has an "Exercise" block — a tiny fill-in-the-blank with one or two missing tokens. You complete the code, click Check answers, and the page tells you if you got it right.

How it works

  • The code template has ____ markers where the answer goes.
  • Type the missing token into each blank.
  • Press Check answers — correct fields turn green, wrong ones red.
  • Show hint uncovers a clue if you're stuck.
  • Many blanks accept multiple equivalent answers (e.g. const or let where both work).

Example shape

Instruction
Use the modern method to attach a click handler.
Template (a blank is shown as ____)
btn.____('click', onClick);

Why the exercises matter

Skill the exercises buildHow
Spelling tricky APIsaddEventListener, querySelectorAll, setProperty — easy to half-remember.
Recognising idiomsObject.fromEntries, Promise.all, arr.filter(Boolean) — the patterns repeat.
Sharpening reading speedFill-the-blank forces you to slow down and parse.
Tip: Doing the exercise on every lesson — even quick ones — compounds. By topic 50 you'll find you write JavaScript without consulting the docs.

Example

Example
<!DOCTYPE html>
<html>
<body>

<p id="out"></p>

<script>
document.getElementById("out").textContent = "Hello from JS Exercises!";
</script>

</body>
</html>
Try it Yourself »

Exercise

What four characters mark a blank?

Answer:

Test yourself

Q1. Exercise blanks are marked with…
Q2. Many blanks accept…
Q3. "Show hint" reveals…

Discussion

Loading…