SLSkillLoop
JavaScript practice

JavaScript Functions Practice

Functions turn repeated logic into reusable code. Practice parameters, return values, function calls, and arrow function syntax with short beginner questions.

How to practice JavaScript functions

JavaScript function practice helps you connect inputs, body logic, and return values. A function is easier to understand when you trace one call from argument to result.

For each question, identify the parameters, plug in the arguments, and decide what value is returned. Then compare regular function syntax with arrow function syntax.

What to focus on
  • Parameters, arguments, and calls
  • return values and undefined
  • Arrow functions and expression bodies

Example practice questions

Try these samples, then continue into the JavaScript Practice Labfor guided browser-based practice.

1

What keyword sends a value back from a function?

Answer: return

2

In function add(a, b), what are a and b?

Answer: Parameters

3

What does add(2, 3) represent?

Answer: A function call with two arguments

4

Which syntax creates a simple arrow function?

Answer: const add = (a, b) => a + b;

5

What happens when a function has no return statement?

Answer: It returns undefined.

6

What is returned by const double = (n) => n * 2; double(4)?

Answer: 8

7

What is the difference between a parameter and an argument?

Answer: A parameter is in the function definition; an argument is passed into the call.