JAVASCRIPT IN PRACTICE

Predict the output

Predict console output. Test your understanding of type conversions, variable scope and execution order.

  • Type coercion
  • Variable scope
  • Asynchronous execution
Start the first challenge →

First challenge without login · Free

Selected challenges to get started

Pick a challenge and explore the rules through a concrete example.

Medium

Truthy and default values

What does the code print? Compare boolean conversion with || and ??. Enter one line with | separators.

Solve challenge → No login required
Medium

Async Order

Analyze the Event Loop. What exactly will the console output?

Solve challenge → No login required
Warm-up

typeof a number

Read the code and type the exact output.

Preview challenge → Free account required to solve

Ready for more?

Available challenges: 34.

See all challenges →

The full catalogue requires a free account.

How should you approach these challenges?

Predicting JavaScript output checks your understanding of type conversion, variable scope and asynchronous execution. It helps you investigate code that looks correct but returns a different value or performs operations in an unexpected order.

Try to determine the output without running the code. Track each expression’s value and type, variable scope and execution order. For asynchronous code, separate synchronous work from scheduled tasks. Submit the required format, including spaces and line breaks.

Put it into practice: Truthy and default values →

Solve this challenge without creating an account.