JSUtil - nil(Object item)

Checks if item is null, undefined, or evaluates to the empty string.

Table 1. Parameters
Name Type Description
item Object The object to check
Table 2. Returns
Type Description
Boolean True if the item is null, undefined, or evaluates to the empty string.

var x = "the quick brown fox";
var y = "";
var z;
 
gs.print("x = '" + x + "', JSUtil.nil(x) = " + JSUtil.nil(x));
gs.print("y = '" + y + "', JSUtil.nil(y) = " + JSUtil.nil(y));
gs.print("z = '" + z + "', JSUtil.nil(z) = " + JSUtil.nil(z));
Output:
x = 'the quick brown fox', JSUtil.nil(x) = false
y = '', JSUtil.nil(y) = true
z = 'undefined', JSUtil.nil(z) = true