A little JavaScript curiosity

Small snippets.
Big aha
moments.

Read the code. Predict the output. Peek at the why. Quick puzzles for JavaScript learners who want to understand what happens next.

  • Step-by-step explanations
  • Guest play, no account
12const a = [1, 2, 3];console.log(a.push(4));4[1, 2, 3, 4]undefinedError
Find the surprise inValuesArraysScopeAsync

TRY IT HERE

One snippet.
Your prediction.

Pick an example, choose the output, then peek at the explanation. Nothing runs and nothing is saved.

THE PEEK BOOTHInteractive example · 1 / 3

One plus a little surprise

What does this code print?

console.log(1 + "2" + 3);
Choose the output

Just an example. No signup, saved answers, or code execution here.

FREE TOOLS

Pick a surprise

FREE ARRAY METHODS QUIZ

Which array changes?

Slice vs splice, map and mutation, shared references. Predict three outputs and peek at the step-by-step explanations. No signup.

Try the array quiz ↗

FREE INTERACTIVE ARRAY TOOL

Slice or splice? See both arrays.

Choose a tested example, predict the return value and the original array, then reveal the indexed before-and-after views.

Try the visualizer ↗

FREE TYPE COERCION QUIZ

A plus sign. A string. A surprise?

Predict three outputs about string concatenation, numeric conversion and equality. Check each answer to see why. No signup.

Try the coercion quiz ↗

Back for more? Saved practice · Choose a topic or find a classroom resource →

THREE SMALL MOVES

Read. Predict.
Then peek.

No editor to configure. No blank page to fill. Just a few lines of JavaScript and a reason to look a little closer.

01

Read the snippet

Trace the values and follow the order. What changes? What stays the same?

02

Make your prediction

Choose the output before you see the answer. A surprise is a useful place to start.

03

Unpack the “why”

Get a step-by-step explanation, not just a green tick. Take the idea to your next snippet.

15Free puzzles in the starter set
3Puzzles in the starter trail
0Signups needed to play
$9One-time, upcoming pack. Never a subscription

YOUR NEXT PEEK

Start free.
Keep the curiosity.

AVAILABLE NOW

The starter set

Free

15 JavaScript puzzles to read, predict and understand.

  • Values, arrays, scope and basic async
  • Answer choices and step-by-step explanations
  • Guest progress saved in your browser
  • Optional account to sync across devices
Play the 15 free puzzles
UPCOMING PACK

Your next aha

$9 USD · once

45 additional puzzles for a deeper look at familiar JavaScript surprises.

  • Closures and mutation
  • Coercion
  • Promise ordering
  • One-time pack, not a subscription
What’s inside the pack

GOOD TO KNOW

A few little answers.

Beginner-to-intermediate JavaScript learners and hobby coders. If you know basic syntax and want to get better at following what code does, take a peek.

Your next aha is
a few lines away.

Try a puzzle

Three puzzles. Step-by-step explanations. No signup needed.