Sample code for 30+ languages & platforms
Ruby

AppendArrayItems Example

Demonstrates the AppendArrayItems function.

Note: This example requires Chilkat v9.5.0.82 or above.

Chilkat Ruby Downloads

Ruby
require 'chilkat'

jarr1 = Chilkat::CkJsonArray.new()
jarr1.Load("[ 1, 2, 3, 4]")

jarr2 = Chilkat::CkJsonArray.new()
jarr2.Load("[ 5, 6, 7, 8]")

jarr1.AppendArrayItems(jarr2)

print jarr1.emit() + "\n";
# Expected output: [1,2,3,4,5,6,7,8]

print jarr2.emit() + "\n";
# Expected output: [5,6,7,8]