JSUtil - doesNotHave(Object item)

Checks if item is null or is undefined.

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

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