Skip to main content

9 docs tagged with "array"

View All Tags

at

at(index: number) focus on the nth element of an array. If index is negative, indexes backward starting from last position of the array. When working with a tuple, use nth instead.

findMany

findMany(p X) => unknown) focus on the subarray of values satisfying the predicate.

findOne

findOne(p X) => unknown) focus on the first value of an array which satisfies a predicate.

foot

foot() focus on the last element of an array. When writing to an empty array, an element will be created. When updating an empty array, it will result in an empty array.

head

head() focus on the first element of an array. When writing to an empty array, element will be created. When updating an empty array, will result in an empty array. It complements tail.

includes

includes(value) focus is a boolean that says whether a given value is included in the array. Setting the value will update the value accordingly.

queue

queue() reads to and removes from the first position of an array, but writes to the last position of the array, making the focus metaphor less relevant. Passing an update function is not likely to make any sense. The name says it!

tail

tail() focus on subarray that remains after skipping the first element. It complements head.