Clarity theorytheory 0/50 · 0%
State · medium

32. Map Operations

Advanced map usage.

Beyond `map-set`, Clarity provides `map-insert` (fails if key exists) and `map-delete`.

clarity
(map-insert Balances tx-sender u100)
(map-delete Balances tx-sender)

Check your understanding

  1. 1. What does map-insert do if the key already exists?