
Category: Objects Kind: Operation Description: Pick items from an object
| Name | Abbreviation | Type | Access | Description |
|---|---|---|---|---|
| Object | O | Object | Item | The object to pick from |
| Keys | K | String | List | The keys to pick |
| Name | Abbreviation | Type | Access | Description |
|---|---|---|---|---|
| Object | O | Object | Item | The object with the picked keys |
A key-value pair is a fundamental concept in programming and data storage, especially in dictionaries, maps, JSON, and databases.
A key-value pair consists of:
Think of a dictionary (the book):
If you look up the key "apple" in the dictionary, the value might be "a fruit that grows on trees".
Take, for example, a real estate listing. It might be stored like this:
property_listing = {
"address": "123 Maple Street",
"price": 450000,
"bedrooms": 3,
"bathrooms": 2,
"square_feet": 1800,
"status": "For Sale"
}
Breakdown of key-value pairs:
| KEY | VALUE |
|---|---|
| address | 123 Maple Street |
| price | 450000 |
| bedrooms | 3 |
| bathrooms | 2 |
| square_feet | 1800 |
| status | For Sale |
Each key describes a property attribute, and each value holds the actual data about it.
This kind of structure is super common in databases, and APIs—makes it easy to store, access, and filter lists.
Object entries refer to the key-value pairs within an object. In JavaScript (and similar structures like JSON), these are called entries because each one is a single unit of information: a key and its corresponding value.
Let’s say you have a JavaScript object:
javascript
CopyEdit
const property = {
address: "123 Maple Street",
price: 450000,
bedrooms: 3
};
The entries of this object are:
["address", "123 Maple Street"]["price", 450000]["bedrooms", 3]Feed in an object
This can be from construct object or any node that results in an object
Feed in a key or a list of keys.
The result is the object entries for those keys