Chapter VI · Functions

Arguments

Arguments are the actual real values passed into a function when it is invoked.

01 How It Works

Think of handing specific ingredients to a chef at a cooking station.

Arguments map directly onto the function's defined parameters in sequential order.

example.js
function square(num) {
  return num * num;
}
square(4); // 4 is the argument
  1. 1. Invoke a target function.

  2. 2. Pass values or variables inside the parentheses.

  3. 3. Receive values via function parameters.

02 Practical Example

Here is how you might see this concept applied in real-world code:

practical.js
function showFullName(first, last) {
  console.log(first + " " + last);
}
showFullName("Jane", "Doe");

Key Takeaway

Arguments supply the concrete data required for function execution.

Related Concepts