No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 
xzx 2ec7739298 [Version] V.3.8 hace 4 años
..
specs [Version] V.3.8 hace 4 años
.npmignore [Version] V.3.8 hace 4 años
LICENSE [Version] V.3.8 hace 4 años
README.md [Version] V.3.8 hace 4 años
index.js [Version] V.3.8 hace 4 años
package.json [Version] V.3.8 hace 4 años

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