I'd start with a vector, for sure. `first` and `last` will work, as you mention, and in many contexts destructuring will result in elegant code. If performance became a problem (in 90%+ of cases it never will) you can do something platform specific to improve performance (a two-element java array, or js NativeArray, or similar)