> For the complete documentation index, see [llms.txt](https://docs.newbot.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.newbot.io/pre-built-function-for-the-widget/map.md).

# Map()

Allows you to transform the elements of an array

Example:

```typescript
array = [{ name: 'ana', age: 18 }, { name: 'ben': age: 20 }]
newArray = Map(array, {
    title: '@name'
}) 
// output is [{ title: 'ana' }, { title: 'ben' }]
```

Give the name of the property to be read starting with an `@`

If you have text after the property, put an `@` at the end

Example:

```typescript
array = [{ name: 'ana', age: 18 }, { name: 'ben': age: 20 }]
newArray = Map(array, {
    title: 'Name is @name@ and age is @age'
}) 
```

Of course, you can read the properties in depth:

```typescript
array = [{ address: { city: 'paris', street: 'gambetta' } }]
newArray = Map(array, {
    title: '@address.city'
}) 
```
