Sample code for 30+ languages & platforms
Go

AppendArrayItems Example

Demonstrates the AppendArrayItems function.

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

Chilkat Go Downloads

Go
    jarr1 := chilkat.NewJsonArray()
    jarr1.Load("[ 1, 2, 3, 4]")

    jarr2 := chilkat.NewJsonArray()
    jarr2.Load("[ 5, 6, 7, 8]")

    jarr1.AppendArrayItems(jarr2)

    fmt.Println(*jarr1.Emit())
    // Expected output: [1,2,3,4,5,6,7,8]

    fmt.Println(*jarr2.Emit())
    // Expected output: [5,6,7,8]

    jarr1.DisposeJsonArray()
    jarr2.DisposeJsonArray()