Skip to content
Buy me a coffee

RandomAccess

Defined in: src/util/guards.ts:18

Marker for lists with fast (O(1)) positional access, such as ArrayList, Vector and List.of lists. Generic algorithms (e.g. Collections.binarySearch, Collections.reverse) check it with isRandomAccess and use get/set loops instead of iterators. A custom list opts in by defining [RANDOM_ACCESS] as true.

readonly [RANDOM_ACCESS]: true

Defined in: src/util/guards.ts:20

Always true; its presence is the marker.