diff --git a/website/docs/language/functions/index_function.mdx b/website/docs/language/functions/index_function.mdx index aae7015780..0839e0cbbf 100644 --- a/website/docs/language/functions/index_function.mdx +++ b/website/docs/language/functions/index_function.mdx @@ -5,7 +5,7 @@ description: The index function finds the element index for a given value in a l # `index` Function -`index` finds the element index for a given value in a list. +`index` finds the first element index for a given value in a list. ```hcl index(list, value) @@ -21,6 +21,13 @@ value is not present in the list. 1 ``` +In this example, the index of the first occurence of `"two"` is returned. + +``` +> index(["one", "two", "two"], "two") +1 +``` + ## Related Functions * [`element`](/terraform/language/functions/element) retrieves a particular element from a list given