Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Section
Column
width70%

API Overview

The array..cat() API concatenates arrays and/or individual values into a new array.

Section
Column
width25%

Parameters

  • array or value - An array or single value to concatenate to the array. This parameter Multiple array/value parameters can be repeated as many times as desiredpassed.
Column
width25%

Return Value

A new array.

...

Code Block
languagejavascript
titleTitle of Example CodeMerge 2 arrays and 3 individual values
pjs.define("a", { type: 'integer', dim: 3 });
pjs.define("b", { type: 'integer', dim: 3 });
pjs.define("c", { type: 'integer', dim: 9 });
 
a = [1, 2, 3];
b = [4, 5, 6];
c = a.cat(b, 7, 8, 9);
// c now contains [1, 2, 3, 4, 5, 6, 7, 8, 9]