Last updated 2 years ago
Was this helpful?
⟩ ⟩ ⟩ ⟩ argument vs. parameter
parameter(s)
live in function's definition (compile-time)
named variable declared in the function.
argument(s)
live in call sites ( runtime, may be different on each call)
a value for the corresponding parameter.
// ⭐️ function's definition (compile-time) function foo( param1, param2, ... ) { ... } // ╰─── parameters ────╯ // ⭐️ values passed into function when called (run-time) foo( 1, 'hello', false ); // ╰─── arguments ───╯
parameter
argument
- an array-like.