Home/Exercises/Functions
exercise set · 27 challenges · beginner to hard

JavaScript Function Exercises

Master JavaScript functions with interactive exercises covering parameters, arguments, return values, arrow functions, callbacks, function references, rest parameters, composition, recursion, debounce, throttle, partial application, and currying. Write and test real code in your browser with immediate feedback.

Choose your next challenge

Exercises

Work from beginner to hard, or use the filters to find a specific skill.

27exercises
About this practice set

Practice designing functions with clear contracts

Functions turn inputs into reusable behavior and let programs separate decisions into clear, testable units. These JavaScript function exercises help you reason about parameters, arguments, calls, return values, callbacks, and composition instead of treating a function as syntax to memorize.

The collection starts with return versus console output, argument order, parameter values, functions as values, conditional returns, reusable input cleanup, default parameters, and rest parameters. Focused JavaScript arrow function practice also covers the difference between expression-body returns and block bodies that need an explicit return statement.

The JavaScript callback practice then develops into validation, safe optional calls, call-result versus function-reference mistakes, composed steps, pipelines, dispatchers, recursion, partial application, debounce, throttle, and currying. These challenges show how real functions coordinate behavior, preserve inputs, and build larger operations from smaller pieces.

Exercises
27
Difficulty
Beginner to Hard
Good to know first
Know variables, expressions, and basic conditional logic; the later exercises also expect comfort with arrays and reading nested calls.
Start with Return vs Log

What you’ll practice

  • Separate parameters from the arguments supplied by a caller
  • Return useful values instead of relying on console output
  • Use functions as values and distinguish references from call results
  • Write arrow functions with correct implicit or explicit returns
  • Call, validate, and safely handle callback functions
  • Accept flexible inputs with defaults and rest parameters
  • Compose steps with pipelines, dispatchers, and partial application
  • Build recursive functions, debounce, throttle, and curried calls

Who these exercises are for

This practice set begins with approachable function fundamentals and progresses to advanced design patterns. It suits learners strengthening core JavaScript, developers looking for callback and arrow-function practice, and anyone who wants to write functions with clearer inputs, outputs, and responsibilities.

How practice works

  • Write and run JavaScript directly in your browser
  • Use instant test feedback to inspect calls and return values
  • Progress from function basics to wrappers and recursive patterns
  • Filter exercises by difficulty and save your progress when signed in