Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ayonli_jsext/esm/array/index.js

A JavaScript extension package for building strong and modern applications.
Latest
import * as ayonliJsext from "https://deno.land/x/ayonli_jsext@v0.9.72/esm/array/index.js";

Variables

v
uniq
deprecated
v
uniqBy
deprecated

Functions

Breaks the array into smaller chunks according to the given length.

Counts the occurrence of the element in the array.

Checks if the array ends with the given suffix.

Performs a shallow compare to another array and see if it contains the same elements as this array.

Returns the first element of the array, or undefined if the array is empty. This function is equivalent to arr[0] or arr.at(0).

Checks if the array contains another array as a slice of its contents.

Returns the last element of the array, or undefined if the array is empty. This function is equivalent to arr[arr.length - 1] or arr.at(-1).

Returns a tuple of two arrays with the first one containing all elements in the given array that match the given predicate and the second one containing all that do not.

Returns a random element of the array, or undefined if the array is empty.

Reorganizes the elements in the array in random order.

Breaks the array into smaller chunks according to the given delimiter.

Checks if the array starts with the given prefix.

Returns a subset of the array that contains only unique items.

Returns a subset of the array that contains only unique items filtered by the given callback function.