Function Parameters vs Arguments in JavaScript – What’s the Difference?

If you're just getting started with JavaScript, it's easy to get confused between parameters and arguments in functions. Don’t worry—they’re closely related but play different roles.
Let’s break it down with clear definitions and examples.
✅ Function Parameters
Parameters are the placeholders or variables listed inside the function definition.
Think of them as input labels your function expects.
function greet(name) {
console.log("Hello, " + name);
}
🔹 In this example:
name
is the parameter.It's like a blank variable waiting to be filled when the function is called.
🧠 Function Arguments
Arguments are the actual values you pass to the function when you call it.
greet("Pushpesh");
🔹 Here:
"Pushpesh"
is the argument.It replaces the parameter
name
inside the function.
🧪 Another Example
function add(a, b) { // a and b → parameters
return a + b;
}
add(3, 4); // 3 and 4 → arguments
📌 Result: The function returns 7
, using the arguments 3
and 4
.
🧠 Quick Summary
Concept | Parameter | Argument |
Where? | In the function definition | In the function call |
What? | Named placeholder for input | Actual value provided to function |
Example | function greet(name) | greet("Alice") |
💬 Common Interview Tip
“Parameters are what you define, arguments are what you pass.”
Subscribe to my newsletter
Read articles from pushpesh kumar directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
