On this page
Function
isEmpty (obj) Boolean public
Module: | @ember/utils |
---|
Defined in packages/ember-metal/lib/is_empty.js:6
import { isEmpty } from '@ember/utils';
- obj
- Object
- Value to test
- returns
- Boolean
Verifies that a value is null
or undefined
, an empty string, or an empty array.
Constrains the rules on isNone
by returning true for empty strings and empty arrays.
isEmpty(); // true
isEmpty(null); // true
isEmpty(undefined); // true
isEmpty(''); // true
isEmpty([]); // true
isEmpty({}); // false
isEmpty('Adam Hawkins'); // false
isEmpty([0,1,2]); // false
isEmpty('\n\t'); // false
isEmpty(' '); // false
© 2020 Yehuda Katz, Tom Dale and Ember.js contributors
Licensed under the MIT License.
https://api.emberjs.com/ember/2.18/functions/@ember%2Futils/isEmpty