Skip to content

Latest commit

 

History

History
73 lines (52 loc) · 1.43 KB

jsonarray.adoc

File metadata and controls

73 lines (52 loc) · 1.43 KB

JsonArray

Represents JSON array object.

Note: to parse string into JsonObject use [func-jsonparse].

Instance attributes

size ⇒ Integer

Number of elements in array

values ⇒ Array

NXSL array with JSON array elements

Instance methods

append(value) ⇒ void

Appends value to JSON array.

Table 1. Parameters

value

?

Add value to JSON array. Value type may vary.

get(index) ⇒ ?

Returns array value by the index. Value type depends on the type used in JSON.

Table 2. Parameters

index

Integer

Index of element in array

Return

Attribute value

insert(index, value) ⇒ void

Sets value to the provided index in JSON array, moving existing element in this position

Table 3. Parameters

index

Integer

Index of element in array

value

?

Add value to JSON array. Value type may vary.

serialize() ⇒ String

Returns string with serialized JSON

Return

String with serialized JSON

set(index, value) ⇒ void

Sets value to the provided index in JSON array, in place of existing element in this position

Table 4. Parameters

index

Integer

Index of element in array

value

?

Add value to JSON array. Value type may vary.

Constructors

JsonArray()

Creates new JSON array.

Return

JsonArray object