23 lines
473 B
JavaScript
23 lines
473 B
JavaScript
|
|
define(function() {
|
||
|
|
'use strict';
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @exports defined
|
||
|
|
*
|
||
|
|
* @param {*} value The object.
|
||
|
|
* @returns {Boolean} Returns true if the object is defined, returns false otherwise.
|
||
|
|
*
|
||
|
|
* @example
|
||
|
|
* if (Cesium.defined(positions)) {
|
||
|
|
* doSomething();
|
||
|
|
* } else {
|
||
|
|
* doSomethingElse();
|
||
|
|
* }
|
||
|
|
*/
|
||
|
|
function defined(value) {
|
||
|
|
return value !== undefined && value !== null;
|
||
|
|
}
|
||
|
|
|
||
|
|
return defined;
|
||
|
|
});
|