> For the complete documentation index, see [llms.txt](https://daseldocs.tomwright.me/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://daseldocs.tomwright.me/syntax/objects-maps.md).

# Objects/maps

An object/map is a set of key value properties.

## Defining a new map

```
{"greeting": "hello"}
```

## Creating a map using existing values

```
{"foo": "bar", "name": "Tom"}. // Just so you can see the input
{
    "baz": foo,
    name // Shorthand for "name": name
}
```

## Adding new fields to a map

We can utilise the spread `...` operator here.

Set `"name" = "Tom"` regardless of what is in the map already:

```
{
  $this...,
  "name": "Tom"
}
```

Set `"name" = "Tom"` only if it doesn't already exist in the map:

```
{
    "name": "Tom",
    $this...
}
```
