Category: Objects Kind: Operation Description: Construct an object
Name | Abbreviation | Type | Access | Description |
---|---|---|---|---|
Existing | E | Object | Item | Existing object to add to |
Data | D | Object | List | The data to add to the object, as a list of key-value pairs |
Name | Abbreviation | Type | Access | Description |
---|---|---|---|---|
Object | O | Object | Item | The constructed object |
In JSON (JavaScript Object Notation), an object is a collection of key-value pairs.
It’s wrapped in curly braces { }
, and each key-value pair inside it follows this format:
json
CopyEdit
"key": value
Here’s a JSON object representing a property listing:
json
CopyEdit
{
"address": "123 Maple Street",
"price": 450000,
"bedrooms": 3,
"bathrooms": 2,
"square_feet": 1800,
"status": "For Sale"
}
{ }
) is a JSON object."address"
is the key, "123 Maple Street"
is the value (a string)."price"
is the key, 450000
is the value (a number).{ ... }
= object (key-value pairs)[ ... ]
= array (Lists of values or objects)json
CopyEdit
{
"listings": [
{
"address": "123 Maple Street",
"price": 450000
},
{
"address": "456 Oak Avenue",
"price": 525000
}
]
}
"listings"
is a key.