Parameter (JavaScript)

A parameter (also known as an input parameter) is a way of receiving a variable into a…

What is a parameter?

A parameter (also known as an input parameter) is a way of receiving a variable into a function.

Parameters are defined when creating a function. The declared paramaters are variables that are in scope throughout the function (they are only available to access inside the function body.)

// the variables *first* and *second* are input parameters
function add(first, second) {
    return first + second;
}

Level: Apprentice · More JavaScript terms at this level

Updated