util.JSONObject.has

Checks if the JSON object contains a specific entry name.

Syntax

util.JSONObject.has(
    name STRING )
  RETURNS BOOLEAN
  1. name is a string identifying a JSON object property.

Usage

The has() method determines if the JSON object holds a property identified by the element name passed as parameter.

The method returns TRUE if the name/value pair exists in the JSON object.

A name/value pair can be set with the put() method.