🔸parameter
named variable passed into function, used to import arguments.
JS ⟩ object ⟩ function ⟩ parameter
⭐ in JS, arguments are passed by value❗️
⭐ function declaration instantiation - how parameters are stored.
types of parameters
❗deplicate parameters ( not allowed in strict mode❗️)
other topics
🔰function declaration instantiation - how parameters are stored.
function declaration instantiation - how parameters are stored.
// ⭐️ parameters:
// • lie in function's definition (compile-time)
function foo( param1, param2, ... ) { ... }
// ╰─── parameters ────╯
// ⭐️ arguments:
// • values passed into function when called (run-time)
// • parameters are initialized to these values.
// • can be different on each call.
foo( 1, 'hello', false );
// ╰─── arguments ───╯
foo( 2, 'world', false );
// ╰─── arguments ───╯Last updated
Was this helpful?