1.0.0 • Published 8 years ago

default-argument v1.0.0

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
8 years ago

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(){}
  )