-
Notifications
You must be signed in to change notification settings - Fork 0
Challenge Passing Values To Functions With Arguments
Parameters
are variables that act as placeholders for the values that are to be input to a function when it is called. When a function is defined, it is typically defined along with one or more parameters. The actual values that are input (or "passed") into a function when it is called are known as arguments
.
Here is a function with two parameters, param1
and param2
:
function functionWithArgs(param1, param2) {
console.log(param1, param2);
}
Then we can call functionWithArgs:
functionWithArgs("Hello", "World");
We have passed two arguments, "Hello"
and "World"
. Inside the function, param1
will equal "Hello" and param2
will equal "World". Note that you could call functionWithArgs
again with different arguments and the parameters would take on the value of the new arguments.
Learn to code and help nonprofits. Join our open source community in 15 seconds at http://freecodecamp.com
Follow our Medium blog
Follow Quincy on Quora
Follow us on Twitter
Like us on Facebook
And be sure to click the "Star" button in the upper right of this page.
New to Free Code Camp?
JS Concepts
JS Language Reference
- arguments
- Array.prototype.filter
- Array.prototype.indexOf
- Array.prototype.map
- Array.prototype.pop
- Array.prototype.push
- Array.prototype.shift
- Array.prototype.slice
- Array.prototype.some
- Array.prototype.toString
- Boolean
- for loop
- for..in loop
- for..of loop
- String.prototype.split
- String.prototype.toLowerCase
- String.prototype.toUpperCase
- undefined
Other Links