kotlinx-serialization / kotlinx.serialization.json / JsonArray / getPrimitive

getPrimitive

(common, js, jvm, native) fun getPrimitive(index: Int): JsonPrimitive

Returns index-th element of an array as JsonPrimitive

Exceptions

IndexOutOfBoundsException - if there is no element with given index

JsonException - if element has invalid type