项目原始demo,不改动
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Deze repo is gearchiveerd. U kunt bestanden bekijken en het klonen, maar niet pushen of problemen/pull-requests openen.
 
 
 
 
xzx 2ec7739298 [Version] V.3.8 4 jaren geleden
..
specs [Version] V.3.8 4 jaren geleden
.npmignore [Version] V.3.8 4 jaren geleden
LICENSE [Version] V.3.8 4 jaren geleden
README.md [Version] V.3.8 4 jaren geleden
index.js [Version] V.3.8 4 jaren geleden
package.json [Version] V.3.8 4 jaren geleden

README.md

NPM Version Build Status

coalescy

Simple function that return the first non null or undefined argument passed to it

Install

npm i --save coalescy

Usage

coalescy simply return the first non nully of the passed elements. Null if all the values are null

it works the same as

a || b

but it works on falsie values too

Example

var clsc = require('coalescy');
var obj = clsc(null, []); // obj = [];
obj = clsc(null, {}); // obj = {};
obj = clsc(null, [], {}); // obj = []; // the first non null
obj = clsc(null, undefined, 0, []) // 0