JavaScript complex variables

In this recipe, we will have a look at JavaScript complex variables, such as arrays, objects, and properties. All these are needed to deal with plugin return codes such as from REST calls.

Getting ready

We need a new workflow and a scriptable task inside it to try it out.

The example workflow 06.01 JavaScript complex variables contains all the examples that follow.

How to do it...

We will look into several different JavaScript complex variable type pieces.

Arrays

Arrays are pretty useful for storing multiple elements of the same type:

  1. To define a new empty array in JavaScript, use either one of the following codes:
    • var family = new Array();
    • var myArray = [];
  2. You can define a new filled array by using either of the following examples: ...

Get VMware vRealize Orchestrator Cookbook - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.