JAVASCRIPT IN PRACTICE

Write a function

Write a function - build a solution from scratch. Trains clean coding and algorithms.

  • Arguments and return values
  • Arrays and objects
  • Edge cases
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.

Warm-up

Is it even?

For integer n, return a boolean: true if n is even, otherwise false. Zero and negative even integers also return true.

Solve challenge → No login required
Easy

Product limit: zero is a setting

An admin panel reads a product limit from an API. Return fallback only when value is null; the JS function should also handle undefined, which JSON fixtures cannot…

Solve challenge → No login required
Medium

The webhook arrived twice

Reject repeated ids for ttl milliseconds after their last acceptance. events are ordered by non-decreasing integer time and have string ids. Accept the first occurrence…

Solve challenge → No login required

Ready for more?

Available challenges: 122.

See all challenges →

The full catalogue requires a free account.

How should you approach these challenges?

JavaScript function exercises practise turning requirements into a specific result: a number, string, array or object. This is useful for transforming API data and building form logic; familiarity with variables, conditions and functions is enough to get started.

Check the function name, arguments and expected return type. Return the value with return; logging it is not a substitute for the function result. Start with a clear solution, run the tests and inspect edge cases. Check whether modifying the input is allowed.

Put it into practice: Is it even? →

Solve this challenge without creating an account.