Determines if the specified object has the specified property.
The property to find.
The object to check.
Optional
Whether to throw instead of returning a value upon failure.
true if property was found, false otherwise.
// Check if object has fieldif (json_has_key({obj: obj, key: "id"})) { // Do your processing}// Throw if not expectedjson_has_key({obj: obj, key: "id", should_throw: true}); Copy
// Check if object has fieldif (json_has_key({obj: obj, key: "id"})) { // Do your processing}// Throw if not expectedjson_has_key({obj: obj, key: "id", should_throw: true});
Determines if the specified object has the specified property.