StackGenVis: Alignment of Data, Algorithms, and Models for Stacking Ensemble Learning Using Performance Metrics
https://doi.org/10.1109/TVCG.2020.3030352
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.
33 lines
814 B
33 lines
814 B
4 years ago
|
/**
|
||
|
* Return the first non null of the passed elements
|
||
|
* it works the same as
|
||
|
*
|
||
|
* a || b
|
||
|
*
|
||
|
* but it works on falsie values too
|
||
|
*
|
||
|
* @method coalescy
|
||
|
* @static
|
||
|
* @return {Object} the first non null of the arguments passed. Null if all the values are null
|
||
|
* @example
|
||
|
* ```javascript
|
||
|
* 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
|
||
|
* ```
|
||
|
*/
|
||
|
module.exports = function clsc() {
|
||
|
var args = arguments;
|
||
|
|
||
|
args = [].slice.call( args );
|
||
|
for (var i = 0, len = args.length; i < len; i++) {
|
||
|
var current = args[ i ];
|
||
|
if ( typeof current !== 'undefined' && current !== null ) {
|
||
|
return current;
|
||
|
}
|
||
|
}
|
||
|
return null;
|
||
|
};
|