(Node.js) AppendArrayItems Example
Demonstrates the AppendArrayItems function.
Note: This example requires Chilkat v9.5.0.82 or above.
var os = require('os');
if (os.platform() == 'win32') {
var chilkat = require('@chilkat/ck-node23-win64');
} else if (os.platform() == 'linux') {
if (os.arch() == 'arm') {
var chilkat = require('@chilkat/ck-node23-linux-arm');
} else if (os.arch() == 'arm64') {
var chilkat = require('@chilkat/ck-node23-linux-arm64');
} else {
var chilkat = require('@chilkat/ck-node23-linux-x64');
}
} else if (os.platform() == 'darwin') {
var chilkat = require('@chilkat/ck-node23-mac-universal');
}
function chilkatExample() {
var jarr1 = new chilkat.JsonArray();
jarr1.Load("[ 1, 2, 3, 4]");
var jarr2 = new chilkat.JsonArray();
jarr2.Load("[ 5, 6, 7, 8]");
jarr1.AppendArrayItems(jarr2);
console.log(jarr1.Emit());
// Expected output: [1,2,3,4,5,6,7,8]
console.log(jarr2.Emit());
// Expected output: [5,6,7,8]
}
chilkatExample();
|