Matrix value: {state.matrix[state.row]![state.col]}
{/* Triple nested access */}Deep nested: {state.nested.arrays[state.nested.index]![state.row]}
First and last: {state.items[0]} and{" "} {state.items[state.items.length - 1]}
{/* Array used in computation and access */}Sum of ends: {state.arr[0]! + state.arr[state.arr.length - 1]!}
Computed index: {state.arr[state.a + state.b]}
{/* Index from computation involving array */}Modulo index: {state.items[state.row % state.items.length]}
{/* Complex index expression */}Complex: {state.arr[Math.min(state.a * 2, state.arr.length - 1)]}
User score:{" "} {state.users[state.selectedUser]!.scores[state.selectedScore]!}
{/* Using one array element as index for another */}Indirect: {state.items[state.indices[0]!]}
{/* Array element used as index for same array */}Self reference: {state.arr[state.arr[0]!]}
Mixed: {state.nested.arrays[state.nested.index]!.length}
{/* Element access followed by property access */}User name length: {state.users[state.selectedUser]!.name.length}
Conditional:{" "} {state.arr[state.a]! > 10 ? state.items[state.b]! : state.items[0]!}
{/* Element access in boolean expression */}Has value: {ifElse( state.matrix[state.row]![state.col]! > 0, "positive", "non-positive", )}
Product: {state.arr[state.a]! * state.arr[state.b]!}
{/* Element access with string concatenation */}Concat: {state.items[0]! + " - " + state.items[state.indices[0]!]!}
{/* Multiple element accesses in single expression */}Sum: {state.arr[0]! + state.arr[1]! + state.arr[2]!}