Object.get

Object.get

Object.get

Function

Read the specified key of the object and return the default value if missing.

Syntax

Parameters

ParametersTypeRequiredDefault valueDescription
keyStringYesNoneThe key to read.
default_valueAnyNoemptyThe default value returned when the key does not exist.

Return value

TypeDescription
AnyThe value of the corresponding key, or the default value.

Code Example

Notes

  • If the field exists and the value is null, null is returned and the default value is not used.