Skip to main content

Arrays

Arrays in Kexra store ordered collections of values.

Why this exists

Arrays enable grouping related data and performing operations on collections.

How it works

Arrays are created with [] syntax. Elements are accessed by index starting from 0.

Examples

set numbers = [1, 2, 3]
say numbers[0] # 1

Common mistakes

  • Accessing out-of-bounds indices
  • Confusing arrays with objects