Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js parameter vs argument

function example(parameter) {
  console.log(parameter); // Output = foo
}

const argument = 'foo';

example(argument);

// Function parameters are the names listed in the function's definition.
// Function arguments are the real values passed to the function.
// Parameters are initialized to the values of the arguments supplied.

// Reference: https://developer.mozilla.org/en-US/docs/Glossary/Parameter
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #parameter #argument
ADD COMMENT
Topic
Name
6+6 =