JS ⟩ object ⟩ function ⟩ parameter ⟩ 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
Argument
Parameter
the "arguments" object - an array-like.
Last updated 1 year ago