What is the difference between a parameter and an argument?

JavaScript

The short answer

A parameter is the variable name in the function definition. An argument is the actual value passed when calling the function. Parameters are placeholders, arguments are the real values that fill them.

The difference

// name and age are PARAMETERS (in the definition)
function greet(name, age) {
console.log(`Hello, ${name}. You are ${age}.`);
}
// "John" and 30 are ARGUMENTS (in the call)
greet('John', 30);

A simple way to remember: parameters are placeholders, arguments are actual values.

In practice

Most developers use these terms interchangeably and everyone understands what they mean. But in a technical interview, knowing the precise difference shows attention to detail.

// Function has 2 parameters
function add(a, b) {
return a + b;
}
// Called with 2 arguments
add(5, 3);
// You can check how many parameters a function has
add.length; // 2

Interview Tip

This is a quick vocabulary question. Define both, show one example, and move on. The memory trick (parameters = placeholders, arguments = actual values) makes it easy to remember.

Why interviewers ask this

This is a simple terminology question that tests precision. It often comes up as a warm-up or as part of a bigger discussion about functions.