json.length
This function gets the number of top-level elements in the JSON object or array.
Syntax
json.length(jsonObjectOrArray)
Arguments
Argument |
Type |
Description |
---|---|---|
jsonObjectorArray |
any |
The JSON object or array. |
Returns
Type |
Description |
---|---|
int |
The top-level items in the JSON object |
Examples
Let us say the jsonObject includes the following.
jsonObject = {
"id": 1,
"name": "bob"
}
The function json.length(jsonObject)
returns 2.