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.
1 2 3 4 5 6 7 8 9 10 |
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 |