Ember.isEmpty()

isEmpty (obj) Booleanpublic

Defined in packages/ember-metal/lib/is_empty.js:4

Verifies that a value is null or an empty string, empty array, or empty function.

Constrains the rules on Ember.isNone by returning true for empty string and empty arrays.

Ember.isEmpty();                // true
Ember.isEmpty(null);            // true
Ember.isEmpty(undefined);       // true
Ember.isEmpty('');              // true
Ember.isEmpty([]);              // true
Ember.isEmpty({});              // false
Ember.isEmpty('Adam Hawkins');  // false
Ember.isEmpty([0,1,2]);         // false
Ember.isEmpty('\n\t');          // false
Ember.isEmpty('  ');            // false

Parameters:

obj Object
Value to test

Returns:

Boolean
doc_EmberJs
2016-11-30 16:51:32
Comments
Leave a Comment

Please login to continue.