This is useful when conditionally formatting the first or last element in a list, or when generating unique identifiers for each element - for example, when formatting HTML tables.
{#each e, i in ['a', 'b', 'c']}
Element: {e}
Index: {i}
{#end}
produces:
Element: a
Index: 0
Element: b
Index: 1
Element: c
Index: 2
This is useful when conditionally formatting the first or last element in a list, or when generating unique identifiers for each element - for example, when formatting HTML tables.
produces: