Description

JsonObjectConst::operator[] gets a value in the object pointed by the JsonObjectConst.

If the JsonObjectConst is null, this function does nothing.

JsonObjectConst::operator[] is a shortcut for JsonObjectConst::getMember().

JsonObjectConst::operator[] is a read-only version of JsonObject::operator[]

Signatures

JsonVariantConst operator[](char* key) const;
JsonVariantConst operator[](const char* key) const;
JsonVariantConst operator[](const __FlashStringHelper* key) const;

JsonVariantConst operator[](const String& key) const;
JsonVariantConst operator[](const std::string& key) const;
JsonVariantConst operator[](std::string_view key) const;  // 🆕 (added in 6.18.1)

Arguments

key: the key associated with the value you want to read.

Return value

JsonObjectConst::operator[] return a JsonVariantConst.

See also

 X online