<div class='type'>Function</div>


<a id='references'></a>


<h2 id="indexforkey-mapping">indexForKey</h2>

<div class='sourceset sourceset-common'>Common</div>


```kotlin
fun SemanticsPropertyReceiver.indexForKey(mapping: (Any) -> Int)
```


The index of an item identified by a given key. The key is usually defined during the creation of
the container. If the key did not match any of the items' keys, the `mapping` must return -1.