Undefined values: Difference between revisions
→{{header|jq}}: {}["key"] yields null
(jq) |
(→{{header|jq}}: {}["key"] yields null) |
||
Line 560:
=={{header|jq}}==
Given a JSON object, o, and a key, k, that is not present in that object, then o[k] evaluates to null, e.g.
In jq as in JSON, null can usually be used to represent an undefined or unspecified value. However, in jq, 1/0 does not yield null: ▼
<lang
▲In
<lang jq>1/0 == null #=>false</lang>
It should also be noted that in jq, null can combine with other values to form non-null values. Specifically, for any JSON entity, e,
|