Function

Module: @ember/utils

Available since v1.5.0

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

A value is blank if it is empty or a whitespace string.

1
2
3
4
5
6
7
8
9
10
11
12
import { isBlank } from '@ember/utils';

isBlank(null);            // true
isBlank(undefined);       // true
isBlank('');              // true
isBlank([]);              // true
isBlank('\n\t');          // true
isBlank('  ');            // true
isBlank({});              // false
isBlank('\n\t Hello');    // false
isBlank('Hello world');   // false
isBlank([1,2,3]);         // false