Skip to content

Parameter

Easy — everyone uses thisGeneral Dev

ELI5 — The Vibe Check

A parameter is the placeholder name inside a function definition — it's the label on the slot where you plug things in. The coffee machine has slots labelled 'beans' and 'water'. What you actually pour in are the arguments.

Real Talk

A parameter is a named variable in a function or method signature that acts as a placeholder for the value (argument) passed when the function is called. Parameters define what inputs a function accepts and their expected types.

Show Me The Code

// 'base' and 'exponent' are parameters
function power(base: number, exponent: number): number {
  return Math.pow(base, exponent);
}

power(2, 10); // 2 and 10 are arguments

When You'll Hear This

"The function signature has too many parameters — consider an options object." / "Add a default parameter value so it's optional."

Made with passive-aggressive love by manoga.digital. Powered by Claude.