Skip to content

LENGTH

Use the LENGTH function to know the number of domains contained in a set.

For example, after an analysis, if the rules detect the following example domains—available in the sample taxonomy in the introduction:

1.02    athletics
1.03    baseball
1.04    football
1.05    gymnastics

that are then put in the workingSet set, this code:

function onCategorizer() {
   var workingSet = CLONE(ALL);
   var domainNumber = LENGTH(workingSet);
   CONSOLE.log(domainNumber)
}

will return 4 in the Output tab of the Console tool window.

The syntax of the LENGTH function is:

LENGTH(set)

where set is the set variable.