Function

isPresent (obj) Boolean public

Module: @ember/utils

Available since v1.8.0

import { isPresent } from '@ember/utils';
obj
Object
Value to test
returns
Boolean

A value is present if it not isBlank.

isPresent();                // false
isPresent(null);            // false
isPresent(undefined);       // false
isPresent('');              // false
isPresent('  ');            // false
isPresent('\n\t');          // false
isPresent([]);              // false
isPresent({ length: 0 });   // false
isPresent(false);           // true
isPresent(true);            // true
isPresent('string');        // true
isPresent(0);               // true
isPresent(function() {});   // true
isPresent({});              // true
isPresent('\n\t Hello');    // true
isPresent([1, 2, 3]);       // true

© 2020 Yehuda Katz, Tom Dale and Ember.js contributors
Licensed under the MIT License.
https://api.emberjs.com/ember/3.25/functions/@ember%2Futils/isPresent