json.get

This function gets the value of the associated key from the JSON object.

Syntax

json.get(jsonObject, key)

Arguments

Argument

Type

Description

jsonObject

any

The JSON object.

key

string

The key for which the value to get

Returns

Type

Description

any

The value associated with the key

Examples

Let us say the jsonObject includes the following.

jsonObject = {
"id": 1,
"name": "bob"
}

The function json.get(jsonObject, "name") returns "bob".