# map() Function & Examples

Use the map() matrix function in Calcul.io. Review its syntax, edit working examples, understand the result, and explore related math functions.

## map

#### map(x, callback)

#### map(x, y, ..., callback)

Try it yourself:

```calculio
map([1, 2, 3], square)
map([1, 2], [3, 4], f(a,b) = a + b)
```

[filter](https://calcul.io/function/filter/index.md)

---

## map(): Applying a Function to Each Value

**map()** applies a function or expression to every entry in a collection, returning a transformed collection of the same general shape. It is useful for conversions, cleanup, and element-by-element mathematical transformations.

## Element-wise intent

For example, map can square each entry or convert every measurement. Use [dotPow()](https://calcul.io/function/dotPow/index.md) when a standard element-wise power is enough, and [dotMultiply()](https://calcul.io/function/dotMultiply/index.md) for matching weights. map is clearer when the per-entry logic is custom.

Ensure the mapping operation accepts every possible entry, including zero, negative, or missing-like values. Use [filter()](https://calcul.io/function/filter/index.md) first to remove unsuitable entries, and verify output shape with [size()](https://calcul.io/function/size/index.md).

[All functions](https://calcul.io/functions/index.md)
