Skip to content

Commit

Permalink
feat(docs): cover fromCell()
Browse files Browse the repository at this point in the history
  • Loading branch information
Gusarich committed Dec 29, 2024
1 parent 63bd32c commit 495e611
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/src/content/docs/book/maps.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,21 @@ contract Example {
}
```

### Convert from a `Cell`, `.fromCell()` {#fromcell}

<Badge text="Available since Tact 1.6 (not released yet)" variant="tip" size="medium"/><p/>

To convert a [`Cell{:tact}`][cell] type back to a map, use the `.fromCell(){:tact}` [method](/book/functions#extension-function).

```tact
// Suppose we have a Cell
let cell: Cell = ...;
// And we want to initialize a map variable from it
let fizz: map<Int, Int> = emptyMap();
fizz.fromCell(cell);
```

### Traverse over entries {#traverse}

To iterate over map entries there is a [`foreach{:tact}`](/book/statements#foreach-loop) loop statement:
Expand Down

0 comments on commit 495e611

Please sign in to comment.