Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Examples

Example 1

Code Block
languagejs
watchers2 = addElementIfNotExist(watchers, currentUser());

Adds currentUser to the watchers array if currentUser is not already present. The routine function returns a new array watchers2, so the initial array will not be modified.

Example 2

Code Block
languagejs
watchers = addElementIfNotExist(watchers, currentUser());

The initial array will be modified as a result of the = operator and NOT of the routine function call.

Note

  1. If arrayName is not defined as an array, the routine function returns error.
  2. If elem is not the same type as declared in the array definition, the routine function returns error.

See also

Filter by label (Content by label)
showLabelsfalse
max25
showSpacefalse
cqllabel = "array_routine" and space = currentSpace ( )
labelsarray_routinesroutine

We've encountered an issue exporting this macro. Please try exporting this page again later.