Utilizor
Contact Us

Parameters & Arguments

Understanding function inputs.

Parameters & Arguments

Function parameters are the names listed in the function definition.

Function arguments are the real values received by the function when it is invoked.

Default Parameters

If a function is called with missing arguments (less than declared), the missing values are set to undefined.

ES6 allows function parameters to have default values.

Example

function myFunction(x, y = 10) {
  return x + y;
}