1.0.0 • Published 8 years ago
default-argument v1.0.0
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(){}
)
1.0.0
8 years ago