Skip to content

Instantly share code, notes, and snippets.

View nickreffitt's full-sized avatar

Nick Reffitt nickreffitt

View GitHub Profile
// example function where arguments 2 and 3 are optional
function example( err, optionalA, optionalB, callback ) {
// retrieve arguments as array
var args = [].slice.call(arguments);
// first argument is the error object
// shift() removes the first item from the
// array and returns it
err = args.shift();