default-argument

1.0.0 • Public • Published

default-argument

Minimal default argument helper

##Install npm i default-argument

##Usage

var defaultArgument = req('default-argument')
//Function with possibly missing argument
function(missing) {
  var missing = defaultArgument(
    //Pass the functions arguments *built-in
    arguments,
    //Specify the position of the argument
    // in arguments to default
    0,
    //Pass the value you want to substitute
    // as the default
    function defaultFunction(){}
  )

Package Sidebar

Install

npm i default-argument

Weekly Downloads

2

Version

1.0.0

License

Apache-2.0

Last publish

Collaborators

  • dam